Magento Apache Config & Memory Issues

7,419

One other useful thing to look at for setting the MAXCLIENTS is ApacheBuddy.

See https://github.com/gusmaskowitz/apachebuddy.pl

This basically looks through the stats and your configuration files and gives you a guideline as to what your MAXCLIENTS setting should be. To be honest I can never afford to go as low as they recommend but it is probably the "correct" answer.

To use/install:

wget https://raw.github.com/gusmaskowitz/apachebuddy.pl/master/apachebuddy.pl

perl apachebuddy.pl

Useful options include -p (for port if you are running varnish for example) and -P (that is a capital "P") to also take into account the PHP memory settings.

Share:
7,419

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    I have a Magento installation on a VPS that is giving me a headache.

    This particular VPS has a reasonable spec - 2gb Memory and 50gb storage. It runs a single domain, with a single Magento install - and nothing else.

    About 5 months ago we started having issues. Every so often (about once every 2 or 3 weeks) the VPS would crash - all processes stopped and the only way to restart the container is via Virtuozzo.

    Now, however its 2 or 3 times a week. My VPS hosts confirm I am breaching the 2gb memory limit, at which point all VPS processes are killed to stop it bringing the entire node down.

    I have not made any config changes to it at all - I was running New Relic on it for a short while, but have removed that in case it was contributing to the issues. I can see nothing in the logs which indicates an issue and we have no CRON jobs running at the time the crashes happen.

    The site generates steady, but not huge amounts of traffic (averaging usually less than 100 visits per day)

    Is there anything in particular I should have done to the Apache or PHP configs to help? Im not a massivley experienced Apache admin, but know more than enough to solve most problems...

    Failing that, any other ideas that might help? Can't afford for this site to be down this much.

    • Anton S
      Anton S over 11 years
      it all depends on the configuration and load on the server. MAgento does not need lot of visitors to hit the 2GB limit , see your memory configuration that is allowed for each request to use and do the math
    • Michael Hampton
      Michael Hampton over 11 years
      Consider not hosting a business critical website within a public Virtuozzo (or OpenVZ) VPS.
    • Taras Chuhay
      Taras Chuhay about 10 years
      and how big your product catalog is?
  • figolu
    figolu over 11 years
    Many thanks - ok, am definitely running mpm-prefork and already have APC installed. Will check out Varnish as well - will this run alongside APC ok? Have tried to implement your apache conf in my vhost.conf (as I am running under plesk). When restarting apache I get an error about 'startserver not allowed in section'...
  • Thomas Maurstad Larsson
    Thomas Maurstad Larsson almost 9 years
    Way to go for including the port flag.