So now we've evolved and moved forward in the development of the Special Olympics site, and some of you will remember my questions about how to choose a web hosting service. Although we chose Webfaction, we may need to move to a dedicated server and VPS, but in truth, I am VERY confused about how to KNOW what our site performance needs, and memory needs, truly are. PLEASE offer advice if you can.
We are have purchased 160mb of extra RAM allocation from webfaction. They say that the first 80, that comes with hosting, is equivalent to 256mb of VPS- I then don't know what it means when our total is actually 240mb- I guess that would be, hopefully, at least 512mb vps equivalent, maybe more. one of you might know better. We're also on the same server as our MySQL databases
Our issues are:
-
Page Execution times are general over 1000 and MUCH higher than that on admin pages- even with APC and Fast CGI and Drupal cache and no Admin menu, still over 1000. We do have a fair number of modules and I've tried shutting offer everything I can. A study of Drupal_load() shows that the total load time for modules seems to be just 32-35ms, so hardly a big part of the total page execution. And even when 800 MySQL queries run on one screen (View or permission or some other complex screen) the total time for that many queries (when that many occur) is about 370ms and that's usually as bad as query time gets. So there are MANY more ms of page execution not clearly explained by module loading or MySQL. Our theme doesn't seem to cause MUCH worse page execution time than Garland, though when we add more blocks to the sidebars, it gets a bit slow, but it's not a major difference I don't think.
-
Despite page execution, there's also simply a bit of a hover as you go to a new page. You know, it says waiting for server... for about a second or two rather than just popping over there- I'm wondering if it's a script load issue and I HAVE considered moving js script loading to the bottom of the page template rather than letting it stay in the head. But I don't know yet if that's the issue
-
I can't figure out a way to set APC so that it never fragments- the TTLs are 0 so shouldn't it fully purge? Instead, it seems to do a messy purge which increases the size of the php-cgi instance after a "cache full" and then apc shows up as fragmented. And no matter how much memory I give to APC, it eventually seems to use all of it. What I'd like to see is that the php-cgi recreates itself more often- if APC cannot purge cleanly, wouldn't it be better to re-initiate the php-cgi? The only problem is what will happen when the site gets a lot more visitors when it goes live.
What is the real impact of:
MaxRequestsPerProcess 500
DefaultInitEnv PHP_FCGI_MAX_REQUESTS 500
-
I can't determine the best httpd.conf configuration of MPM Worker and i'm not clear on the most powerful settings in that file. I know that MaxClients is important but I'm not sure what it means so I can't figure out a good setting for it. I'm also confused by MaxRequests, both kinds- for PHP-FCGI and for Apache. And what does ServerLimit really mean? I keep finding web sites that simply repeat the Apache documentation but they never explain ir real world scenarios the actual impact of many settings.
-
We installed memcached 2.0.0b1 because it allows for socket (rather than port) based connections. Then we installed the Drupal Memcache API. When it's activate, some simple page views seem faster, but THEN- WE CAN'T SAVE VIEWS AND OFTEN CAN'T SAVE NODES. It just hangs and we get an Internal server error- so we have to shut down memcache. what could be causing that? Sadly the Unix/server error log doesn't show an entry for what happened.
-
Any opinions regarding igbinary serializer? We are using it with apc and we're assuming it's a good thing.
I've seen the link at:
http://www.morningtime.com/Drupal-6x-Performance-Guide/513
But it overwhelms me. I've tried a lot of those things, and most are only helpful during production or for static pages or anonymous users. We also need an overall greater speed on the admin side.
The FIRST things I want to learn to tweak are php.ini and httpd.conf.
**Httpd.conf fcgi and mpm worker setting areas look like this right now but we've tried a lot of different things:
### mod_fcgid PHP Configuration:
LoadModule fcgid_module modules/mod_fcgid.so
# MaxProcessCount and DefaultMaxClassProcessCount should be set to the same value.
# They set the number of burstable processes.
# General guide: Shared1=6, Shared2=9, Shared3=12, Shared4=15
MaxProcessCount 1
DefaultMaxClassProcessCount 1
# DefaultMinClassProcessCount is the number of persistent processes, unaffected by ProcessLifeTime.
# Set this to 0 if you want to keep your idle RAM usage very low:
DefaultMinClassProcessCount 1
# The life time of a burstable process. Keep this at 200 so you don't use too much RAM:
ProcessLifeTime 200
# Keep IdleScanInterval at 30. It sets the frequency that ProcessLifeTime is checked:
IdleScanInterval 30
# BusyTimeout is the number of seconds a single request can take.
# If you are serving large downloads from PHP, you may want a high value:
# 21600 = six hours. 300 = five minute.
BusyTimeout 21600
# IPC* are connection settings between the fcgid module and your fcgi app:
IPCCommTimeout 240
IPCConnectTimeout 30
# Set the maximum number of requests a process should handle before it is killed.
# MaxRequestsPerProcess must be lower than 'PHP_FCGI_MAX_REQUESTS':
MaxRequestsPerProcess 500
DefaultInitEnv PHP_FCGI_MAX_REQUESTS 500
# Apache Process Settings
StartServers 4
MinSpareThreads 10
MaxSpareThreads 25
ThreadsPerChild 25
MaxClients 150
MaxRequestsPerChild 1000
<VirtualHost 127.0.0.1:41414>
ServerName yourdomain.com
ServerAlias www.yourdomain.com
# Standard CGI:
AddHandler cgi-script .py .cgi
# Force CGI processing of .phpcgi files with the php-cgi binary:
ScriptAlias /php-exe-path/ /home/soncnv/webapps/phpstack/php_fcgi/bin/php-cgi
AddType application/x-httpd-php .phpcgi
Action application/x-httpd-php "/php-exe-path/php-cgi"
AddHandler fcgid-script .php .fcgi
DefaultInitEnv PHPRC /home/soncnv/webapps/phpstack/php_fcgi/lib/php.ini
FCGIWrapper /home/soncnv/webapps/phpstack/php_fcgi/bin/php-cgi .php
*** Our php.ini looks like this but I've played around a lot with apc settings:
memory_limit="128M"
magic_quotes_gpc = 0
register_globals = 0
session.auto_start = 0
mbstring.http_output = pass
mbstring.http_input = pass
mbstring.encoding_translation = 0
memcache.hash_strategy = consistent
upload_max_filesize = 10M
post_max_size = 10M
extension="igbinary.so"
;session.serialize_handler="igbinary"
extension="memcached.so"
; ; ::: miko note- this was in here twice :::
;memcache.hash_strategy="consistent"
extension="apc.so"
apc.enabled="1"
apc.shm_segments="1"
;commenting this out allows you to set it in each fastcgi process
apc.shm_size="80M"
apc.num_files_hint="2000"
apc.user_entries_hint="0"
; ; ::: miko optimization :::
;apc.ttl="7200"
;apc.user_ttl="7200"
apc.ttl="0"
apc.user_ttl="0"
apc.gc_ttl="600"
apc.cache_by_default="1"
;apc.filters=""
apc.mmap_file_mask="/tmp/apcphp5.XXXXXX"
apc.slam_defense="0"
apc.file_update_protection="2"
apc.enable_cli="0"
apc.max_file_size="1M"
apc.stat="1"
apc.write_lock="1"
apc.report_autofilter="0"
apc.include_once_override="0"
apc.rfc1867="0"
apc.rfc1867_prefix="upload_"
apc.rfc1867_name="APC_UPLOAD_PROGRESS"
apc.rfc1867_freq="0"
apc.localcache="0"
apc.localcache.size="1000"
apc.coredump_unmap="0"
apc.serializer="igbinary"
; ; ::: eAccelerator Configuration :::
; ; Disabled by default because it increases RAM usage.
; ; If you want eAccelerator to have a positive effect on your site's
; ; performance, then you should set DefaultMinClassProcessCount to a
; ; value higher than 0 (probably 2 or higher) in your httpd.conf file.
; ; You can enable eAccelerator by removing the ';' characters from
; ; the beginning of the following lines:
;extension="eaccelerator.so"
;eaccelerator.shm_size="16"
;eaccelerator.cache_dir="/home/soncnv/webapps/phpstack/php_fcgi/eaccelerator"
;eaccelerator.enable="1"
;eaccelerator.optimizer="1"
;eaccelerator.check_mtime="1"
; eaccelerator.debug="0"
; eaccelerator.filter=""
; eaccelerator.shm_max="0"
; eaccelerator.shm_ttl="0"
; eaccelerator.shm_prune_period="0"
; eaccelerator.shm_only="0"
; eaccelerator.compress="1"
; eaccelerator.compress_level="9"
; ; ::: ionCube Configuration :::
zend_extension="/home/soncnv/webapps/phpstack/ioncube/ioncube_loader_lin_5.2.so"
Any advice appreciated. right now only 4-5 people are working on the site daily, but we're probably giving it a fair number of hits. I'd let you see the site if I could.