Tag Info

Hot answers tagged

5

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=128 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

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

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

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 ...


3

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.


3

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 ...


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

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

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

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).


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 ...


2

APC and suhosin are not available in stable repository. you can install it from dotdeb repo, by adding following to your sources.list deb http://packages.dotdeb.org squeeze all deb-src http://packages.dotdeb.org squeeze all deb http://packages.dotdeb.org squeeze-php54 all deb-src http://packages.dotdeb.org squeeze-php54 all also, you can install apc for ...


2

This answer states you need to pass an argument to clear_apc_cache and that only with apc.enable_cli=1 will the APC cache clearing work through CLI calls. You might want to clear_apc_cache again with the after:restart hook to ensure the previous release is fully cleared.


2

1) Does it matter if fragmentation becomes 100%? Does it impact performance in any way? Only if APC tries to add new stuff into the shm. Since your getting a 99.9% hit rate (and the only misses were for loading the files initially) it's not affecting the performance. 2) Why does fragmentation not go down? Because the ttl only comes into play when ...


2

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 ...


2

It appears that your VPS was preinstalled with various scripts which are useful for providing shared web hosting services. Among these are cPanel and suPHP. While these can be convenient to use, if you aren't actually providing shared web hosting and you're the only person using the machine, then they're mostly redundant and unnecessary. SuPHP, in ...


2

You need to wait for it to turn up in the official Ubuntu repository, or install PEAR and use PECL/PEAR to install APC but I don't know if that will work for you on Ubuntu Assuming you have PEAR/PECL installed (and any other necessary dependencies), this should install APC from that repository, which may be at a higher version than the Ubuntu package. It ...


2

Since you are running a released version of ubuntu, you shouldn't expect newer upstream versions of software to be released for that version of ubuntu, only security patches to older versions. You can see here that 3.1.10 has been released for a newer release of ubuntu. You can try backporting that version. To backport, first you need to add a deb-src line ...


2

When using APC one of the things you need to ask yourself how much memory will be allocated to APC. apc.shm_size controls how much memory will be allocated. All my setups are configured to use 30M (I believe 32M is the default option). Also, check your "cache full count" to ensure APC is actually working. This shows how often the cache is at maximum ...


2

Either remove /opt/php5/etc/conf.d/apc.ini or comment all lines in it with a ;. Don't forget to restart your webserver afterwards. Also check '/etc//php5/apache2/php.ini' for 'extension=apc.so' to outcomment. If you still have the sources around, you could try to do a make uninstall afterwards. I don't know if the makefile contains this target.


2

The best solution for installing APC on Debian systems is to use the dot.deb packages. The official Debian APC package is still using version 3.0.19-2 which is very outdated. Using the dot.deb package will also allow you to use the latest version of PHP. Instructions: For the main Dotdeb repository, depending on your distribution (lenny/oldstable or ...


1

The issue with APC and mod_php is that mod_php is inside the same process as apache. This means you only get to have one configuration for PHP for all your vhosts. Try looking into PHP's FastCGI interface. Unfortunately I don't have a lot of experience with setting this up on apache (we use nginx), but we've used this to great effect to separate ...


1

How did you install php-5.3.8? The php-devel package has to version match with your installed php. Install the corresponding php-devel first and then try again with installing php-pear. I don't know if that package will be looking for a particular version of php, though. If so, you'll need to find the version-appropriate php-pear package.


1

Regarding Question 3, I cant exactly tell you why the circle is not fully closed, but it looks the same for my setup, after a few days uptime and with 10% fragmentation. 2, I think that's a glitch in the APC Statistics Page, mine tells me "10.34% (771.7 KBytes out of 7.3 MBytes in 89 fragments) " where 7.3 MBytes is excatly the amount of memory that ...


1

We are seeing the same issue here with random memory leaks, in this case with the information you have given I would raise a bug and from there you have a choice of waiting for a fix, fixing the code yourself or working around it. Also to note I have only seen this occurring with the use of USER cache, and not opcode, I have offset this here by using ...


1

Some notes about APC and the different modes: APC's cache is essentially per-process. If you use CGI, the process is created, APC creates its cache, and then the process ends and the cache clears. (from what I can find, suPHP seems to be CGI-like). If you use FastCGI, Apache spawns one process for each simultaneous request. It keeps them around in case ...


1

I'm not sure what happens if you enable compression in multiple layers, but I would enable it in the topmost layer, i.e. Nginx. This catches dynamically produced PHP content, but also static content that is served directly by Nginx. I see compression as one of the final output filters before sending the content to the client.



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