Off-page speed optimization at server
|
06-02-2011, 03:56 PM
Post: #1
|
|||
|
|||
Off-page speed optimization at server
Hello Everyone,
Not sure whether there is a previous thread for this topic. If so, please point me to it and moderator can close this one. I'm hoping we can share some optimal configuration suggestions for httpd.config or apache2.config (ubuntu). I know many variables apply here (heavy mysql, php's, etc) and there's probably not a "one-size-fits-all" answer, but it may be good to exchange information for the benefit of all. On-page website speed tweaking tips is only one half of the equation, the other half lies on what powers your website and how that power is delivered optimally. Even if you don't have root access into your server, talk about what can be done at .htaccess level. For instance, by now we are all aware of the part that "KeepAlive ON" plays into website speed. How about running PHP as FastCGI? Disable DNS lookups? Optimizing PHP? Spreading your workload by running SQL on a different server? Prefork & Worker MPM settings? This one is underrated and plays a crucial part. Regards to all! Joe |
|||
06-03-2011, 03:15 AM
Post: #2
|
|||
|
|||
RE: Off-page speed optimization at server
1 - If you haven't installed PHP APC, do it NOW! (sudo apt-get install php-apc). It will cache the compiled PHP bytecode and improve the performance of the server
2 - See #1 3 - If you're not on shared hosting, I'm actually a fan of running PHP as a module and not CGI (even FastCGI). That depends on how you run Apache though because it doesn't work with all MPM's. |
|||
06-03-2011, 08:51 AM
Post: #3
|
|||
|
|||
RE: Off-page speed optimization at server
Thanks Pat!
I just installed using yum since my server runs Plesk (dependencies?). Also added extension=apc.so into apc.ini file. Based on phpinfo, I'm assuming it installed and is enabled. I copied snapshot of phpinfo for your review. **As an added security layer, I've implemented code below into .htaccess (highly recommended!), it can be momentarily turned off to view file info from browser. <Files ~ "(php\.ini|\.htaccess|\.php.?|\.py|\.pl|\.cgi)$"> order deny,allow deny from all </Files> ============================================= Does it look OK? apc APC Support enabled Version 3.1.9 APC Debugging Disabled MMAP Support Enabled MMAP File Mask no value Locking type pthread mutex Locks Serialization Support php Revision $Revision: 308812 $ Build Date Jun 2 2011 17:48:08 Directive Local Value Master Value apc.cache_by_default On On apc.canonicalize On On apc.coredump_unmap Off Off apc.enable_cli Off Off apc.enabled On On apc.file_md5 Off Off apc.file_update_protection 2 2 apc.filters no value no value apc.gc_ttl 3600 3600 apc.include_once_override Off Off apc.lazy_classes Off Off apc.lazy_functions Off Off apc.max_file_size 1M 1M apc.mmap_file_mask no value no value apc.num_files_hint 1000 1000 apc.preload_path no value no value apc.report_autofilter Off Off apc.rfc1867 Off Off apc.rfc1867_freq 0 0 apc.rfc1867_name APC_UPLOAD_PROGRESS APC_UPLOAD_PROGRESS apc.rfc1867_prefix upload_ upload_ apc.rfc1867_ttl 3600 3600 apc.serializer default default apc.shm_segments 1 1 apc.shm_size 32M 32M apc.slam_defense On On apc.stat On On apc.stat_ctime Off Off apc.ttl 0 0 apc.use_request_time On On apc.user_entries_hint 4096 4096 apc.user_ttl 0 0 apc.write_lock On On Joe |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)