Autor Tópico: php+Mssql+Apache Timeout  (Lida 137061 vezes)

Offline zzedmm

  • Usuário Ubuntu
  • *
  • Mensagens: 13
    • Ver perfil
php+Mssql+Apache Timeout
« Online: 14 de Junho de 2011, 09:40 »
Pessoal,
Estou com um problema com timeout de consulta via php.
Esse problema acontece exporadicamente, tenho tudo instalado perfeitamente. Porém estou com o servidor em uma máquina virtual, VMWARE.

Se eu altero que o arquivo de configuração do freetds e reinicio a máquina volta a funcionar sem o timeout.

Na minha máquina local esse problema não ocorre. Já comparei as configurações e estão exatamente iguais.

Tenho instalado: PHP5 Apache2 freetds tudo na última versão do ubuntu.

PS: Tirei algumas linhas para entrar no post.
Segue a configuração do PHP(phpinfo):
Citar
PHP Version 5.3.5-1ubuntu7.2

System    Linux srvi007 2.6.38-8-generic-pae #42-Ubuntu SMP Mon Apr 11 05:17:09 UTC 2011 i686
Build Date    May 2 2011 23:04:25
Server API    Apache 2.0 Handler
Virtual Directory Support    disabled
Configuration File (php.ini) Path    /etc/php5/apache2
Loaded Configuration File    /etc/php5/apache2/php.ini
Scan this dir for additional .ini files    /etc/php5/apache2/conf.d
Additional .ini files parsed    /etc/php5/apache2/conf.d/gd.ini, /etc/php5/apache2/conf.d/imagick.ini, /etc/php5/apache2/conf.d/mssql.ini, /etc/php5/apache2/conf.d/mysql.ini, /etc/php5/apache2/conf.d/mysqli.ini, /etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_dblib.ini, /etc/php5/apache2/conf.d/pdo_mysql.ini, /etc/php5/apache2/conf.d/pdo_pgsql.ini, /etc/php5/apache2/conf.d/pgsql.ini
PHP API    20090626
PHP Extension    20090626

Directive   Local Value   Master Value
engine   1   1
last_modified   0   0
xbithack   0   0

Apache Environment
Variable   Value
HTTP_HOST    192.168.0.64
HTTP_USER_AGENT    Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
HTTP_ACCEPT    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_LANGUAGE    pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
HTTP_ACCEPT_ENCODING    gzip, deflate
HTTP_ACCEPT_CHARSET    ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_KEEP_ALIVE    115
HTTP_COOKIE    PHPSESSID=nthth8i3blr2l3819eb8nu3o11
HTTP_VIA    1.1 proxy.superimec.com.br (squid/3.0.STABLE13)
HTTP_X_FORWARDED_FOR    192.168.0.178
HTTP_CACHE_CONTROL    max-age=259200
HTTP_CONNECTION    keep-alive
PATH    /usr/local/bin:/usr/bin:/bin
SERVER_SIGNATURE    <address>Apache/2.2.17 (Ubuntu) Server at 192.168.0.64 Port 80</address>
SERVER_SOFTWARE    Apache/2.2.17 (Ubuntu)
SERVER_NAME    192.168.0.64
SERVER_ADDR    192.168.0.64
SERVER_PORT    80
REMOTE_ADDR    192.168.0.253
DOCUMENT_ROOT    /var/www

Host    192.168.0.64
User-Agent    Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Accept    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language    pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding    gzip, deflate
Accept-Charset    ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive    115
Cache-Control    max-age=259200
Connection    keep-alive
HTTP Response Headers
X-Powered-By    PHP/5.3.5-1ubuntu7.2
Vary    Accept-Encoding
Content-Encoding    gzip
Core
PHP Version    5.3.5-1ubuntu7.2

Directive   Local Value   Master Value
allow_call_time_pass_reference   Off   Off
allow_url_fopen   On   On
allow_url_include   Off   Off
always_populate_raw_post_data   Off   Off
arg_separator.input   &   &
arg_separator.output   &   &
asp_tags   Off   Off
auto_append_file   no value   no value
auto_globals_jit   On   On
auto_prepend_file   no value   no value
browscap   no value   no value
default_charset   no value   no value
default_mimetype   text/html   text/html
define_syslog_variables   Off   Off
disable_classes   no value   no value
disable_functions   no value   no value
display_errors   On   On
display_startup_errors   Off   Off
doc_root   no value   no value
docref_ext   no value   no value
docref_root   no value   no value
enable_dl   Off   Off
error_append_string   no value   no value
error_log   no value   no value
error_prepend_string   no value   no value
error_reporting   30711   30711
exit_on_timeout   Off   Off
expose_php   On   On
extension_dir   /usr/lib/php5/20090626+lfs   /usr/lib/php5/20090626+lfs
file_uploads   On   On
highlight.bg   #FFFFFF   #FFFFFF
highlight.comment   #FF8000   #FF8000
highlight.default   #0000BB   #0000BB
highlight.html   #000000   #000000
highlight.keyword   #007700   #007700
highlight.string   #DD0000   #DD0000
html_errors   Off   Off
ignore_repeated_errors   Off   Off
ignore_repeated_source   Off   Off
ignore_user_abort   Off   Off
implicit_flush   Off   Off
include_path   .:/usr/share/php:/usr/share/pear   .:/usr/share/php:/usr/share/pear
log_errors   On   On
log_errors_max_len   1024   1024
magic_quotes_gpc   Off   Off
magic_quotes_runtime   Off   Off
magic_quotes_sybase   Off   Off
mail.add_x_header   On   On
mail.force_extra_parameters   no value   no value
mail.log   no value   no value
max_execution_time   3000   3000
max_file_uploads   30   30
max_input_nesting_level   64   64
max_input_time   -1   -1
memory_limit   1528M   1528M
open_basedir   no value   no value
output_buffering   4096   4096
output_handler   no value   no value
post_max_size   38M   38M
precision   14   14
realpath_cache_size   16K   16K
realpath_cache_ttl   120   120
register_argc_argv   Off   Off
register_globals   Off   Off
register_long_arrays   Off   Off
report_memleaks   On   On
report_zend_debug   On   On
request_order   GP   GP
safe_mode   Off   Off
safe_mode_exec_dir   no value   no value
safe_mode_gid   Off   Off
safe_mode_include_dir   no value   no value
sendmail_from   no value   no value
sendmail_path   /usr/sbin/sendmail -t -i    /usr/sbin/sendmail -t -i
serialize_precision   100   100
short_open_tag   On   On
SMTP   localhost   localhost
smtp_port   25   25
sql.safe_mode   Off   Off
track_errors   Off   Off
unserialize_callback_func   no value   no value
upload_max_filesize   32M   32M
upload_tmp_dir   no value   no value
user_dir   no value   no value
user_ini.cache_ttl   300   300
user_ini.filename   .user.ini   .user.ini
variables_order   GPCS   GPCS
xmlrpc_error_number   0   0
xmlrpc_errors   Off   Off
y2k_compliance   On   On
zend.enable_gc   On   On

ctype
ctype functions    enabled

dba
DBA support    enabled
Supported handlers    cdb cdb_make db4 inifile flatfile

Directive   Local Value   Master Value
dba.default_handler   flatfile   flatfile

dom
DOM/XML    enabled
DOM/XML API Version    20031129
libxml Version    2.7.8
HTML Support    enabled
XPath Support    enabled
XPointer Support    enabled
Schema Support    enabled
RelaxNG Support    enabled

ereg
Regex Library    Bundled library enabled

exif
EXIF Support    enabled
EXIF Version    1.4 $Id: exif.c 293036 2010-01-03 09:23:27Z sebastian $
Supported EXIF Version    0220
Supported filetypes    JPEG,TIFF

Directive   Local Value   Master Value
exif.decode_jis_intel   JIS   JIS
exif.decode_jis_motorola   JIS   JIS
exif.decode_unicode_intel   UCS-2LE   UCS-2LE
exif.decode_unicode_motorola   UCS-2BE   UCS-2BE
exif.encode_jis   no value   no value
exif.encode_unicode   ISO-8859-15   ISO-8859-15

fileinfo
fileinfo support   enabled
version    1.0.5-dev

Directive   Local Value   Master Value
gd.jpeg_ignore_warning   0   0

gettext
GetText Support    enabled

Directive   Local Value   Master Value
iconv.input_encoding   ISO-8859-1   ISO-8859-1
iconv.internal_encoding   ISO-8859-1   ISO-8859-1
iconv.output_encoding   ISO-8859-1   ISO-8859-1

imagick
imagick module   enabled
imagick module version    3.0.0RC1
imagick classes    Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version    ImageMagick 6.6.2-6 2011-03-16 Q16 http://www.imagemagick.org
ImageMagick copyright    Copyright (C) 1999-2010 ImageMagick Studio LLC
ImageMagick release date    2011-03-16
ImageMagick number of supported formats:    198
ImageMagick supported formats    3FR, A, AI, ART, ARW, AVI, AVS, B, BGR, BGRA, BMP, BMP2, BMP3, BRF, BRG, C, CAL, CALS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DFONT, DNG, DPX, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FITS, FRACTAL, FTS, G, G3, GBR, GIF, GIF87, GRADIENT, GRAY, GRB, GROUP4, HALD, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, INFO, INLINE, IPL, ISOBRL, J2C, JNG, JP2, JPC, JPEG, JPG, JPX, K, K25, KDC, LABEL, M, M2V, M4V, MAP, MAT, MATTE, MIFF, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MTV, MVG, NEF, NULL, O, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG24, PNG32, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, R, RADIAL-GRADIENT, RAF, RAS, RBG, RGB, RGBA, RGBO, RLA, RLE, SCR, SCT, SFW, SGI, SHTML, SR2, SRF, STEGANO, SUN, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, Y, YCbCr, YCbCrA, YUV

Directive   Local Value   Master Value
imagick.locale_fix   0   0
imagick.progress_monitor   0   0

json
json support    enabled
json version    1.2.1

libxml
libXML support    active
libXML Compiled Version    2.7.8
libXML Loaded Version    20708
libXML streams    enabled

mbstring
Multibyte Support    enabled
Multibyte string engine    libmbfl
HTTP input encoding translation    disabled

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

Multibyte (japanese) regex support    enabled
Multibyte regex (oniguruma) backtrack check    On
Multibyte regex (oniguruma) version    4.7.1

Directive   Local Value   Master Value
mbstring.detect_order   no value   no value
mbstring.encoding_translation   Off   Off
mbstring.func_overload   0   0
mbstring.http_input   pass   pass
mbstring.http_output   pass   pass
mbstring.http_output_conv_mimetypes   ^(text/|application/xhtml\+xml)   ^(text/|application/xhtml\+xml)
mbstring.internal_encoding   no value   no value
mbstring.language   neutral   neutral
mbstring.strict_detection   Off   Off
mbstring.substitute_character   no value   no value

mhash
MHASH support    Enabled
MHASH API Version    Emulated Support

mssql
MSSQL Support   enabled
Active Persistent Links    0
Active Links    0
Library version    FreeTDS

Directive   Local Value   Master Value
mssql.allow_persistent   On   On
mssql.batchsize   0   0
mssql.charset   no value   no value
mssql.compatability_mode   Off   Off
mssql.connect_timeout   3000   3000
mssql.datetimeconvert   On   On
mssql.max_links   Unlimited   Unlimited
mssql.max_persistent   Unlimited   Unlimited
mssql.max_procs   Unlimited   Unlimited
mssql.min_error_severity   10   10
mssql.min_message_severity   10   10
mssql.secure_connection   Off   Off
mssql.textlimit   Server default   Server default
mssql.textsize   Server default   Server default
mssql.timeout   3060   3060


pdo_pgsql
PDO Driver for PostgreSQL   enabled
PostgreSQL(libpq) Version    8.4.8
Module version    1.0.2
Revision    $Id: pdo_pgsql.c 300351 2010-06-10 12:11:19Z iliaa $

Phar
Phar: PHP Archive support   enabled
Phar EXT version    2.0.1
Phar API version    1.1.1
SVN revision    $Revision: 305584 $
Phar-based phar archives    enabled
Tar-based phar archives    enabled
ZIP-based phar archives    enabled
gzip compression    enabled
bzip2 compression    enabled
OpenSSL support    enabled

Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.

Directive   Local Value   Master Value
phar.cache_list   no value   no value
phar.readonly   On   On
phar.require_hash   On   On

posix
Revision    $Revision: 305507 $

Reflection
Reflection   enabled
Version    $Revision: 305605 $

session
Session Support    enabled
Registered save handlers    files user
Registered serializer handlers    php php_binary wddx

Directive   Local Value   Master Value
session.auto_start   Off   Off
session.bug_compat_42   Off   Off
session.bug_compat_warn   Off   Off
session.cache_expire   1800   1800
session.cache_limiter   nocache   nocache
session.cookie_domain   no value   no value
session.cookie_httponly   Off   Off
session.cookie_lifetime   0   0
session.cookie_path   /   /
session.cookie_secure   Off   Off
session.entropy_file   no value   no value
session.entropy_length   0   0
session.gc_divisor   1000   1000
session.gc_maxlifetime   14400   14400
session.gc_probability   1   1
session.hash_bits_per_character   5   5
session.hash_function   0   0
session.name   PHPSESSID   PHPSESSID
session.referer_check   no value   no value
session.save_handler   files   files
session.save_path   /var/lib/php5   /var/lib/php5
session.serialize_handler   php   php
session.use_cookies   On   On
session.use_only_cookies   On   On
session.use_trans_sid   0   0

shmop
shmop support    enabled

SimpleXML
Simplexml support   enabled
Revision    $Revision: 302715 $
Schema support    enabled

soap
Soap Client    enabled
Soap Server    enabled

Directive   Local Value   Master Value
soap.wsdl_cache   1   1
soap.wsdl_cache_dir   /tmp   /tmp
soap.wsdl_cache_enabled   1   1
soap.wsdl_cache_limit   5   5
soap.wsdl_cache_ttl   86400   86400

sockets
Sockets Support    enabled

SPL
SPL support   enabled
Interfaces    Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes    AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException

standard
Dynamic Library Support    enabled
Path to sendmail    /usr/sbin/sendmail -t -i

Directive   Local Value   Master Value
assert.active   1   1
assert.bail   0   0
assert.callback   no value   no value
assert.quiet_eval   0   0
assert.warning   1   1
auto_detect_line_endings   0   0
default_socket_timeout   2600   2600
from   no value   no value
safe_mode_allowed_env_vars   PHP_   PHP_
safe_mode_protected_env_vars   LD_LIBRARY_PATH   LD_LIBRARY_PATH
url_rewriter.tags   a=href,area=href,frame=src,input=src,form=fakeentry   a=href,area=href,frame=src,input=src,form=fakeentry
user_agent   no value   no value

sysvmsg
sysvmsg support    enabled
Revision    $Revision: 303429 $

tokenizer
Tokenizer Support    enabled

wddx
WDDX Support   enabled
WDDX Session Serializer    enabled

xml
XML Support    active
XML Namespace Support    active
libxml2 Version    2.7.8

xmlreader
XMLReader    enabled

xmlwriter
XMLWriter    enabled

zip
Zip    enabled
Extension Version    $Id: php_zip.c 305848 2010-11-30 11:04:06Z pajoye $
Zip version    1.9.1
Libzip version    0.9.0

zlib
ZLib Support    enabled
Stream Wrapper support    compress.zlib://
Stream Filter support    zlib.inflate, zlib.deflate
Compiled Version    1.2.1.1
Linked Version    1.2.3.4

Directive   Local Value   Master Value
zlib.output_compression   Off   Off
zlib.output_compression_level   -1   -1
zlib.output_handler   no value   no value

Additional Modules
Module Name
sysvsem
sysvshm

Environment
Variable   Value
APACHE_RUN_DIR    /var/run/apache2
APACHE_PID_FILE    /var/run/apache2.pid
PATH    /usr/local/bin:/usr/bin:/bin
APACHE_LOCK_DIR    /var/lock/apache2
LANG    C
APACHE_RUN_GROUP    www-data
APACHE_RUN_USER    www-data
APACHE_LOG_DIR    /var/log/apache2
PWD    /

PHP Variables
Variable   Value
_COOKIE["PHPSESSID"]   nthth8i3blr2l3819eb8nu3o11
_SERVER["HTTP_HOST"]   192.168.0.64
_SERVER["HTTP_USER_AGENT"]   Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
_SERVER["HTTP_ACCEPT"]   text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
_SERVER["HTTP_ACCEPT_LANGUAGE"]   pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
_SERVER["HTTP_ACCEPT_ENCODING"]   gzip, deflate
_SERVER["HTTP_ACCEPT_CHARSET"]   ISO-8859-1,utf-8;q=0.7,*;q=0.7
_SERVER["HTTP_KEEP_ALIVE"]   115
_SERVER["HTTP_COOKIE"]   PHPSESSID=nthth8i3blr2l3819eb8nu3o11
_SERVER["HTTP_VIA"]   1.1 proxy.superimec.com.br (squid/3.0.STABLE13)
_SERVER["HTTP_X_FORWARDED_FOR"]   192.168.0.178
_SERVER["HTTP_CACHE_CONTROL"]   max-age=259200
_SERVER["HTTP_CONNECTION"]   keep-alive
_SERVER["PATH"]   /usr/local/bin:/usr/bin:/bin
_SERVER["SERVER_SIGNATURE"]   <address>Apache/2.2.17 (Ubuntu) Server at 192.168.0.64 Port 80</address>
_SERVER["SERVER_SOFTWARE"]   Apache/2.2.17 (Ubuntu)
_SERVER["SERVER_NAME"]   192.168.0.64
_SERVER["SERVER_ADDR"]   192.168.0.64
_SERVER["SERVER_PORT"]   80
_SERVER["REMOTE_ADDR"]   192.168.0.253
_SERVER["DOCUMENT_ROOT"]   /var/www
_SERVER["SERVER_ADMIN"]   webmaster@localhost
_SERVER["SCRIPT_FILENAME"]   /var/www/sispeddist/phpinfo.php
_SERVER["REMOTE_PORT"]   47143
_SERVER["GATEWAY_INTERFACE"]   CGI/1.1
_SERVER["SERVER_PROTOCOL"]   HTTP/1.0
_SERVER["REQUEST_METHOD"]   GET
_SERVER["QUERY_STRING"]   no value
_SERVER["REQUEST_URI"]   /sispeddist/phpinfo.php
_SERVER["SCRIPT_NAME"]   /sispeddist/phpinfo.php
_SERVER["PHP_SELF"]   /sispeddist/phpinfo.php
_SERVER["REQUEST_TIME"]   1308054042

PHP License

This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.

////////////////////////

Configuração do Freetds:
cat /etc/freetds/freetds.conf
Citar
#   $Id: freetds.conf,v 1.12 2007/12/25 06:02:36 jklowden Exp $
#
# This file is installed by FreeTDS if no file by the same
# name is found in the installation directory.  
#
# For information about the layout of this file and its settings,
# see the freetds.conf manpage "man freetds.conf".  

# Global settings are overridden by those in a database
# server specific section
[global]
        # TDS protocol version
;       tds version = 4.2

        # Whether to write a TDSDUMP file for diagnostic purposes
        # (setting this to /tmp is insecure on a multi-user system)
;       dump file = /tmp/freetds.log
;       debug flags = 0xffff

        # Command and connection timeouts
        timeout = 1010
        connect timeout = 1010

        # If you get out-of-memory errors, it may mean that your client
        # is trying to allocate a huge buffer for a TEXT field.  
        # Try setting 'text size' to a more reasonable limit
        text size = 64512

# A typical Sybase server
[egServer50]
        host = symachine.domain.com
        port = 5000
        tds version = 5.0

# A typical Microsoft server
[egServer70]
        host = ntmachine.domain.com
        port = 1433
        tds version = 7.0






Offline zekkerj

  • Usuário Ubuntu
  • *
  • Mensagens: 19.735
  • Gratidão gera gratidão, lamúria atrai lamúria...
    • Ver perfil
    • Blog do Zekke
Re: php+Mssql+Apache Timeout
« Resposta #1 Online: 14 de Junho de 2011, 11:11 »
O que seria esse FreeTDS?

Outra coisa, no título vc colocou "Mssql". É "MS", mesmo? Pq o mais comum é usar o MySQL, no próprio Linux. Se eu entendi, vc está consultando uma base SQL num servidor Windows, é isso mesmo?
Pesquise antes de perguntar, sua dúvida pode já ter sido respondida.
Não respondo dúvidas por MP, coloque sua dúvida no fórum onde ela pode ser pesquisada pelos seus colegas!
Não venha ao fórum apenas para perguntar. Se você sabe a resposta de um problema, porque não ajudar seu colega? ;D

Offline zzedmm

  • Usuário Ubuntu
  • *
  • Mensagens: 13
    • Ver perfil
Re: php+Mssql+Apache Timeout
« Resposta #2 Online: 14 de Junho de 2011, 12:04 »
freetds é o conector usado para fazer conexões com o SQL Server.
A conexão é feita de um cliente ubuntu(Que também é servidor[PHP-APACHE] em uma VMWARE), para um servidor SQL SERVER 2005.

Se necessário posso colocar o LOG do freetds aqui.

http://www.php.net/mssql
http://www.freetds.org/

Alguém já passou por essa situação?
Pode ser algo relacionado à VMWare?
« Última modificação: 14 de Junho de 2011, 12:05 por zzedmm »

Offline zzedmm

  • Usuário Ubuntu
  • *
  • Mensagens: 13
    • Ver perfil
Re: php+Mssql+Apache Timeout
« Resposta #3 Online: 22 de Junho de 2011, 09:29 »
Troquei o método de conexão de mssql_connect() para mssql_pconnect() e não adiantou.
Parece ser uma coisa que o php está fazendo baseado na utilização da máquina. Visto que ela está em testes e está pouco usada, o php não limita o tempo máximo. Isso está certo ?
Se reinicio a máquina, alterando o time out no php.ini ou no freetds.conf, volta a funcionar corretamente.

Offline zekkerj

  • Usuário Ubuntu
  • *
  • Mensagens: 19.735
  • Gratidão gera gratidão, lamúria atrai lamúria...
    • Ver perfil
    • Blog do Zekke
Re: php+Mssql+Apache Timeout
« Resposta #4 Online: 22 de Junho de 2011, 11:29 »
Explica melhor a situação. Vc está usando o sistema cliente numa VM, e o banco de dados no sistema hospedeiro, é isso? Se for, pode ser que seu problema seja de memória... tanto o VMware quanto qualquer banco SQL gastam muita memória. E se isso estiver fazendo sua máquina usar excessivamente a memória virtual, pode ser o motivo do sistema dar timeout.
Pesquise antes de perguntar, sua dúvida pode já ter sido respondida.
Não respondo dúvidas por MP, coloque sua dúvida no fórum onde ela pode ser pesquisada pelos seus colegas!
Não venha ao fórum apenas para perguntar. Se você sabe a resposta de um problema, porque não ajudar seu colega? ;D

Offline zzedmm

  • Usuário Ubuntu
  • *
  • Mensagens: 13
    • Ver perfil
Re: php+Mssql+Apache Timeout
« Resposta #5 Online: 22 de Junho de 2011, 16:28 »
Tenho o servidor web(apache + php)Ubuntu, com conector para serviço sqlserver(mssql)
Tenho outro servidor SQLserver.

O primeiro tem 2 processadores e 2 giga de ram, 2 G de swap. E o relatório ocupa 100MB de processamento. (VMware)
O segundo tem 4 processadores com 2 núcleos cada um. 16 Giga de Ram. Também não é memória.  (Máquina física)

Acesso via navegador o servidor Ubuntu.

LOG do Freetds:
Citar
util.c:162:Changed query state from QUERYING to PENDING
net.c:779:Sending packet
0000 01 01 01 62 00 00 00 00-20 20 20 20 20 20 20 20 |...b....         |
0010 20 20 20 20 20 20 20 20-20 20 20 20 6c 65 66 74 |             left|
0020 20 6a 6f 69 6e 20 73 70-72 6f 6d 5f 70 65 64 69 | join sp rom_pedi|
0030 64 6f 66 6f 72 6e 65 63-65 64 6f 72 65 73 20 65 |dofornec edores e|
0040 28 6e 6f 6c 6f 63 6b 29-20 4f 4e 20 28 20 65 2e |(nolock)  ON ( e.|
0050 63 6f 64 70 65 64 69 64-6f 3d 64 2e 63 6f 64 70 |codpedid o=d.codp|
0060 65 64 69 64 6f 20 61 6e-64 20 62 2e 63 6f 64 70 |edido an d b.codp|
0070 72 6f 6d 6f 63 61 6f 66-69 6c 69 61 6c 3d 65 2e |romocaof ilial=e.|
0080 63 6f 64 70 72 6f 6d 6f-63 61 6f 66 69 6c 69 61 |codpromo caofilia|
0090 6c 20 29 0d 0a 20 20 20-20 20 20 20 20 20 20 20 |l )..            |
00a0 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 77 |                w|
00b0 68 65 72 65 20 61 2e 63-6f 64 70 72 6f 6d 6f 63 |here a.c odpromoc|
00c0 61 6f 20 3d 20 34 30 35-30 0d 0a 20 20 20 20 20 |ao = 405 0..     |
00d0 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 20 |                 |
00e0 20 20 20 20 20 20 20 61-6e 64 20 63 2e 73 74 61 |       a nd c.sta|
00f0 74 75 73 21 3d 39 20 61-6e 64 20 62 2e 73 74 61 |tus!=9 a nd b.sta|
0100 74 75 73 21 3d 39 20 61-6e 64 20 64 2e 73 74 61 |tus!=9 a nd d.sta|
0110 74 75 73 21 3d 39 0d 0a-20 20 20 20 20 20 20 20 |tus!=9..         |
0120 20 20 20 20 20 20 20 20-20 20 20 20 20 20 20 6f |                o|
0130 72 64 65 72 20 62 79 20-63 6f 64 66 6f 72 6e 65 |rder by  codforne|
0140 2c 20 63 2e 63 6f 64 69-74 70 72 6f 64 2c 20 73 |, c.codi tprod, s|
0150 6f 2e 6f 72 64 65 6d 2c-20 62 2e 63 6f 64 66 69 |o.ordem,  b.codfi|
0160 6c 20                  -                        |l |

dblib.c:4532:dbsqlok(0x21a08688)
util.c:334:tdserror(0x218a6f20, 0x21a08db0, 20004, 104)
dblib.c:7782:dbperror(0x21a08688, 20004, 104)
dblib.c:7835:20004: "Read from the server failed"
dblib.c:7856:"Read from the server failed", client returns 2 (INT_CANCEL)
util.c:368:tdserror: client library returned TDS_INT_CANCEL(2)
util.c:389:tdserror: returning TDS_INT_CANCEL(2)
util.c:162:Changed query state from PENDING to DEAD
dblib.c:4565:dbsqlok() not done, calling tds_process_tokens()
token.c:495:tds_process_tokens(0x21a08db0, 0xbfc52eb8, 0xbfc52ebc, 0x6914)
util.c:118:logic error: cannot change query state from DEAD to READING
dblib.c:3093:dbcancel(0x21a08688)
dblib.c:7782:dbperror(0x21a08688, 20047, 0)
dblib.c:7835:20047: "DBPROCESS is dead or not enabled"
dblib.c:7856:"DBPROCESS is dead or not enabled", client returns 2 (INT_CANCEL)
dblib.c:3093:dbcancel(0x21a08688)
dblib.c:7782:dbperror(0x21a08688, 20047, 0)
dblib.c:7835:20047: "DBPROCESS is dead or not enabled"
dblib.c:7856:"DBPROCESS is dead or not enabled", client returns 2 (INT_CANCEL)


Offline zekkerj

  • Usuário Ubuntu
  • *
  • Mensagens: 19.735
  • Gratidão gera gratidão, lamúria atrai lamúria...
    • Ver perfil
    • Blog do Zekke
Re: php+Mssql+Apache Timeout
« Resposta #6 Online: 22 de Junho de 2011, 17:11 »
Citar
O segundo tem 4 processadores com 2 núcleos cada um. 16 Giga de Ram. Também não é memória.  (Máquina física)
E sistema operacional de 64 bits, eu presumo. Senão, vc está com 12,5Giga de ram ociosos aí, de bobeira...
Pesquise antes de perguntar, sua dúvida pode já ter sido respondida.
Não respondo dúvidas por MP, coloque sua dúvida no fórum onde ela pode ser pesquisada pelos seus colegas!
Não venha ao fórum apenas para perguntar. Se você sabe a resposta de um problema, porque não ajudar seu colega? ;D

Offline zzedmm

  • Usuário Ubuntu
  • *
  • Mensagens: 13
    • Ver perfil
Re: php+Mssql+Apache Timeout
« Resposta #7 Online: 22 de Junho de 2011, 17:18 »
Citar
O segundo tem 4 processadores com 2 núcleos cada um. 16 Giga de Ram. Também não é memória.  (Máquina física)
E sistema operacional de 64 bits, eu presumo. Senão, vc está com 12,5Giga de ram ociosos aí, de bobeira...

Sim servidor do SQL Server é um 64Bits.


O problema não é no ubuntu, e sim em algo do php +apache + freetds

Offline bjverde

  • Usuário Ubuntu
  • *
  • Mensagens: 26
    • Ver perfil
Re: php+Mssql+Apache Timeout
« Resposta #8 Online: 21 de Julho de 2011, 10:44 »
Estou com um problema com timeout de consulta via php.

zzedmm,

Estou com um problema semelhante. Porem no meu caso estava tentando usar o XAMPP no windows mesmo.

Windows 7 32 bits, XAMPP 1.7.1, PHP 5.2.9, PDO_MSSQL + MS SQL Server 2008

Fatal error: Maximum execution time of 60 seconds exceeded in D:\xampp\htdocs\teste2.php on line 23

Agora estou tentando montar uma VM com Ubuntu e estou com o mesmo problema.

Offline zekkerj

  • Usuário Ubuntu
  • *
  • Mensagens: 19.735
  • Gratidão gera gratidão, lamúria atrai lamúria...
    • Ver perfil
    • Blog do Zekke
Re: php+Mssql+Apache Timeout
« Resposta #9 Online: 21 de Julho de 2011, 10:59 »
Olá bjverde,

Este fórum é voltado a problemas com o Ubuntu. Se você usa outro Linux, ou Windows, sugiro que procure um fórum misto, como o Guia do Hardware (http://www.hardware.com.br/comunidade).
Pesquise antes de perguntar, sua dúvida pode já ter sido respondida.
Não respondo dúvidas por MP, coloque sua dúvida no fórum onde ela pode ser pesquisada pelos seus colegas!
Não venha ao fórum apenas para perguntar. Se você sabe a resposta de um problema, porque não ajudar seu colega? ;D

Offline bjverde

  • Usuário Ubuntu
  • *
  • Mensagens: 26
    • Ver perfil
Re: php+Mssql+Apache Timeout
« Resposta #10 Online: 21 de Julho de 2011, 11:24 »
Outra referencia da falha do problema

http://ubuntuforums.org/showthread.php?t=1675922

porem ate agora nenhuma solução