![]() ![]() Enhancements to FastCGI, such as fastcgi_finish_request() - a special function to finish request & flush all data while continuing to do something time-consuming (video converting, stats processing, etc.Emergency restart in case of accidental opcode cache destruction.Its goal is to provide a free, open, and robust framework for caching and optimizing. Ability to start workers with different uid/gid/chroot/environment and different php.ini (replaces safe_mode) The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. ![]() Advanced process management with graceful stop/start.Basic statistics (ala Apache’s mod_status) (NEW!).Both the servers (Nginx and PHP-FPM) just have the similar pool mechanism. Just to distinguish PHP-FPM worker processes are not the same as Nginx worker processes. Scalable means PHP-FPM can scale the number of its own worker processes that are currently running based on the need-and based on the php-fpm settings. To determine the PHP-FPM speed one would need to explore much, so we can take this as a well-known-truth. And it is fast and scalable. As of PHP 5.3.3 PHP-FPM is in its core so you don’t need special install. PHP-FPM (FPM = “FastCGI Process Manager”) integrates well with Nginx. So my wild guess – you would probable use PHP-FPM. Nginx has no out-of-the-box-modules for PHP. There are many caching engines available for PHP but I like APC for its simplicity.If Apache has some advantages over Nginx – that would be the ease you can enable PHP. “Disk enhanced” is better for Page Cache & Minify Cache. Note: W3 Total cache will offer APC storage option for Page Cache and Minify Cache also. If you are using W3 Total Cache plugin, then you must make use of APC for Database Cache and Object Cache. Once you are done with tweaking, you need to restart PHP. Command: service php5-fpm restart APC & WordPress + WP3 Total Cache Number of data entries APC can store (default is 4096) apc.user_entries_hint=20000 Number of op-code “files” APC can store (default is 1000) apc.num_files_hint=20000 Maximum size of a single file APC can store (default is 1MB) apc.max_file_size=10M Total RAM storage allocated for APC (default is 32 MB) apc.shm_size=1024M Zend opcode cache config: Opcode Caching Up and Running Optimization Enabled Startup OK Shared memory model mmap Cache hits 71322 Cache misses 1049 Used memory 13544916 Free memory 42838688 Wasted memory 10725260 Cached scripts 298 Cached keys 309 Max keys 3907. There are many APC configuration options, but I recommend making changes to the following: PHP 5.4.27 and APC 3.1.13, Centos server with about 4 GB ram, APC is using php-fpm. If apc.php is showing miss-rate above 10%, the chances are high that you need to change value of some APC configuration option. You can tweak APC’s parameter by editing vim /etc/php5/conf.d/20-apc.ini (if you have installed PHP this way). In other cases, you can simply add following values to your php.ini You can change a few more defaults to customize web-based UI as per your needs. Just open apc.php file and edit following line: defaults('ADMIN_PASSWORD','password') // Admin Password - CHANGE THIS TO ENABLE!!! In case you want to use admin-side of apc.php, you will need to change default password to something else. Just copy it to your site’s web-root folder: cp /usr/share/doc/php-apc/apc.php /var/www//htdocs Thankfully, APC comes with file apc.php, which provides a simple web-based interface. Its always better to check if APC is working correctly. Once activated, it starts caching PHP codes automatically. It also works nicely with W3 Total Cache plugin for storing Object & MySQL caches. While we installed PHP with other things, we also installed a php-apc package.ĪPC is one of the most popular caching mechanism for PHP’s op-code caching. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |