We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18373 ☆ A M B ☆
    • 3,141 Posts
    Heya,

    On one specific server with, coincidently, one of our bigger clients MODx is *extremely* slow. And with extremely, I mean that the connection sometimes times out in the manager and sometimes the front-end also, but for as far as I can see, not as often. Sometimes the tree menu (which is the most obvious thing not loading, aswell as the workspace) loads instantly where sometimes it takes 60 seconds and php times out on the mysql_pconnect.


    Some phpinfo() details (top block):
    PHP Version 5.2.14
    
    System 	Linux lswfront6 2.6.26-2-686-bigmem #1 SMP Thu Sep 16 20:29:07 UTC 2010 i686
    Build Date 	Sep 15 2010 16:24:20
    Configure Command 	'./configure' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-mysql' '--enable-ftp' '--with-gd=/usr' '--with-jpeg-dir=/usr' '--with-config-file-path=/usr/home/ws/lswtools/' '--enable-mbstring' '--with-freetype-dir=/usr/home/ws/lswtools/software/freetype-2.1.10/' '--with-zlib' '--with-openssl' '--enable-zip' '--enable-calendar' '--with-gdbm' '--enable-exif' '--with-mime-magic' '--with-curl=/usr/lib/' '--with-png-dir' '--with-pdo-mysql' '--with-mysqli=/usr/bin/mysql_config' '--with-mcrypt'
    Server API 	Apache 2.0 Handler
    Virtual Directory Support 	disabled
    Configuration File (php.ini) Path 	/usr/home/ws/lswtools/
    Loaded Configuration File 	/usr/home/ws/lswtools/php.ini
    Scan this dir for additional .ini files 	(none)
    additional .ini files parsed 	(none)
    PHP API 	20041225
    PHP Extension 	20060613
    Zend Extension 	220060519
    Debug Build 	no
    Thread Safety 	disabled
    Zend Memory Manager 	enabled
    IPv6 Support 	enabled
    Registered PHP Streams 	https, ftps, compress.zlib, php, file, data, http, ftp, zip
    Registered Stream Socket Transports 	tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
    Registered Stream Filters 	zlib.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed 


    The only different to other installs I could find related to the database (errors made me believe that the trouble has to do with the database connection.. ) was the fact that on other servers the MySQL server is "localhost" where on this server it’s "mysql.hostername.nl". I’m far from a sysadmin, but I can imagine that something on localhost is faster then something remotely... but still - that difference can’t surely be 20-30 seconds on average?


    Anyway - I sent in a ticket to the hosting company to check if there’s something wrong with the connection or if there’s something more they can find out... their response:
    Wij hebben het probleem laten onderzoeken door onze afdeling beheer. Zij geven het volgende aan wat het probleem veroorzaakt:

    Is het mogelijk om Persistent connections uitzetten naar de MySQL server (mysql_pconnect)?
    We’ve had the management department investigate the issue. They highlighted what they think caused the problem:

    Is it possible to turn persistent connections to the mysql server off (mysql_pconnect)?


    So yeah. Is that possible? I could do a find on the modx folder and change all pconnect to connect, but my guts are telling me that will result in unwanted results.... (I have no idea what the actual change entails)

    Looking forward to some expert advice...
      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.