Question

High CPU Usage by Prestashop on Apache2

Posted March 12, 2016 4.6k views
Apache PHP Server Optimization Debian Configuration Management Load Balancing Linux Commands

Hello.
I have a 2GB Droplet and I have problem with high CPU usage when someone is on the website. The site is running on Apache2 and Prestashop.
When site is online the CPU usage is 1-2%, but When somebody will enter on the site, the CPU usage by Apache2 is 60-70%.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

What version of PHP are you running? If you’re running PHP 5.6.x, you might consider enabling OPcache with a configuration like this:

[opcache]
opcache.memory_consumption=64
opcache.interned_strings_buffer=4
opcache.max_accelerated_files=4096
opcache.revalidate_freq=600
opcache.fast_shutdown=1
opcache.enable_cli=1
opcache.enable=1
opcache.dups_fix=0
opcache.load_comments=0
opcache.use_cwd=1
opcache.validate_timestamps=1
opcache.save_comments=0
opcache.enable_file_override=1
opcache.inherited_hack=1
opcache.protect_memory=2

Also, lower your KeepAlive timeout, and follow the documentation here for a performance boost:

http://doc.prestashop.com/display/PS16/Performance+Parameters

Submit an Answer