Tag Info

Hot answers tagged

9

APC is by far the best option out of the three. eAccelerator is beginning to lose its foundation and seems to have issues with the latest version of PHP. APC can be found here. There are a lot of other links out there but this is a reputable one (assuming that's the latest version). The main settings to define in your php.ini file will be: ...


9

PHP 5.5 has built-in opcode optimizer OPcache making APC obsolete. According to APC changelogs, PHP up to only 5.4 is supported. Please use OPcache with PHP 5.5+ http://www.php.net/manual/en/opcache.installation.php


8

yum install pcre-devel . You need the Perl-compatible regular expression library development header files You mention Ubuntu, might as well use apt-get install libpcre3-dev


6

Instead of removing APC, which will cause a massive performance hit, and effectively shoot yourself in the foot.. Try this: in /etc/php5/conf.d/apc.ini: extension=apc.so apc.shm_size=128M apc.shm_segments=1 apc.max_file_size=5M apc.num_files_hint=10000 apc.slam_defense = 0 apc.write_lock=1 You can increase apc.shm_size to a value bigger than 128, say 512 ...


5

If this does not cause visible errors on the site, it must happen so early during the apache child process creation that no request has been transferred to the child before the error. Googleing for the error message suggests (http://www.litespeedtech.com/support/forum/showthread.php?t=4242) that your APC configuration is incorrect and you should check ...


5

Do I see it correctly that the fragmentation happens because the cache is used as an user cache too? No, fragmentation can happen when a file's opcode cache size has changed, and it won't fit into the 'slice' it occupied before - under the hood it's a bit more complicated, but that's the gist. Why does the fragmentation bar tell me 100% of only ...


4

APC (advanced php cache) works with PHP, not Nginx. You may know from phpinfo script, that apc extension is used; specifically, save this code as a .php file and view it through the web: <?php phpinfo(); ?>


4

Found it.. It was because of apc.mmap_file_mask set into "straight file-backed mmap" like said oficial APC doc. Since server setup is multithreaded and apc was stored in fysical file, it was stucking by the reason of locked file. Its very important to set it into shared memory. So now my apc.ini is: apc.gc_ttl="600" apc.cache_by_default="1" apc.filters = ...


4

Cached variables: 3562 ( 14.3 MBytes) This is what's causing your fragmentation. GC is cleaning them up and chances are they're getting placed in a new 'slice' when they're regenerated. You could try to up the GC TTL on user variables - but if the code for your APC usage is manually handling the TTL's that may be a part of the problem. 3500+ vars is ...


4

After switching every apc_store call with apc_add the problem with 'zombie' memory disappeared. Probably has something to do with a race condition with apc_fetch and apc_store as discussed on http://notmysock.org/blog/php/user-cache-timebomb.html. It's advised to use apc_add instead, especially these calls are user generated.


4

Since the leading cause seemed to be journaling, that would have been my next step. In order to remove journaling, however, I would need to attach the EBS volume to another instance. I decided to test the procedure out using a (day old) snapshot, however, before removing journaling, I re-ran the 10 minute iotop test (on the test instance). To my surprise, I ...


4

600 is not low for apc.gc_ttl and 3600 is actually the default value, you are right that it will vary on different installations, I have mine set to 600 as well.


4

If you use 3.1.14 in your development environment and everything is working as expected, I would use the same versions in your production environment. This result in the best possibility to prevent unforeseen errors. If you are planning on using a stable (or any other different) version in your production environment: first test it in your development ...


4

We can see that your instance is running very low on memory, and is actually swapping. This is disk I/O for which you'll get billed, and also causes your site to run slower. Free up some memory by stopping unnecessary processes and tuning your web server to run fewer workers (e.g. Apache or php-fpm).


4

Memcached requires your code to actually use it. But if you wrote this code then this should be easy to do :) MySQL caching works to an extent. Ideally, upgrade to SSD drives if not already. I've never heard of FastCGI caching. Are you referring to caching dynamic pages as static? Honestly, if you have tuned everything that best that you can, I would ...


4

You gave the APC cache 2GB of RAM, but your VPS only has 2GB of RAM! Therefore the system must swap in order to do anything at all. To resolve the problem, reduce the size of the APC cache, or add more RAM.


4

This should really be a comment, but it's a bit long isn't it too high or too low ? If you don't know how, then how should we? You haven't told us how much RAM and swap there is, how much is used for other stuff. You haven't told us how much of the APC memory is used before the system crashes. file is not a core file (its format was not ...


3

when you dont need special features from varnish, you could drop it and use nginx's fastcgi_cache. but beware, in opposite to proxy_cache your can have only 1 cache_zone in your whole setup. maybe your setup is a little over-optimized ... i'd think about either use nginx or varnish only. when it comes to memcache: depending on how many requests/second ...


3

You don't list us the PHP modules. You most likely have something like PHP Accelerator, XCache or similar in place, a front-end cache such as Varnish caching stuff or some other black magic you won't reveal us. For the caches such as XCache, see their manual how to operate from this. For the front-end caches such as Varnish, see their manual. Other than ...


3

How do I check APC cache is running? The best way is to browse apc.php When I install PHP one of the first things I do is copy the apc.php file into my web root. cp /usr/share/doc/php-apc/apc.php /var/www/public/apc.php You can then go to domain.com/apc.php and view what is being cached, clear the cache, check on memory usage etc You may need to ...


3

Have you tried removing php53u? A simple: yum remove php53u Followed by: yum install php54 Should be doing the trick for you. If it does not, then you can try removing the php53u package(s) using the 'rpm' tool, leaving dependencies intact, but first check the list of packages installed so you can later re-install them from the new php54 repository: ...


3

This message comes from nginx — apparently it decided to serve the request by returning a static file, but that file is not present. The cache in question is on the PHP application level, because the request URL path starts with /cache/ — it is not some kind of internal cache in nginx or APC. Possible causes: Maybe the request should have been passed to a ...


3

The error message says No such file or directory. And you say that the directory doesn't exist. So create the directory.


3

More than likely some module php is including is causing your segfaults. You will need to do some debugging to figure out what could be causing it. Here's a good place to start: Turn on core files: http://aplawrence.com/Linux/limit_core_files.html Read the core dump with GDB: http://stackoverflow.com/questions/5115613/core-dump-file-analysis That'll give ...


3

apc is being displayed rather than interpreted. The vhost it resides on is probably not configured to interpret PHP files. Fix your vhost configuration (make sure the PHP module is loaded or the CGI is configured, and the appropriate AddType directive for PHP files has been added to your Apache configuration. (Instructions on how to do both of these items ...


3

Have you tried APC.php on the active web server? if you are using SHM and not MMAP that could explain this. The filemask simply allows it to save the ap file with random digits as per your specification to a particular location. You can even send it to /dev/zero as per a blog post here http://www.nigeldunn.com/2011/05/02/unable-to-allocate-memory-pool/ Here ...


3

It appears you have request_slowlog_timeout enabled. This normally takes any request longer than N seconds, logs that it was taking a long time, then logs a stack trace of the script so you can see what it was doing that was taking so long. In your case, the stack trace (to determine what the script is doing) is failing. If you're running out of ...


3

are you the only user on the server? Do you host for other people/accounts? Can people upload php scripts to be run on your server? If the answer any of the above is Yes, then using something SuPHP is recommended, since it offers an extra layer of protection by forcing it to run as the user, as opposed to the user the webserver runs as. If you remove ...


3

apc acts as PHP module, wnile nginx is webserver and working with php via cgi interface. Shortly, web server configuration isn't an easy task and platform to choose depends on maany maany things. 10k connections - what does it mean, 10k parallel downloads? If video is delivered as files for same server - should be no problem with apache. better think about ...


3

Did you add: extension=apc.so to your php.ini file and restart your web server afterwards?



Only top voted, non community-wiki answers of a minimum length are eligible