Troubleshoot memory issues on CentOS 7 web server

by ,

We have by far the largest RPM repository with dynamic stable NGINX modules and VMODs for Varnish 4.1 and 6.0 LTS. If you want to install NGINX, Varnish, and lots of useful modules for them, this is your one-stop repository to get all performance-related software.
You have to maintain an active subscription in order to be able to use the repository!

Current status of this article is open draft of sorts 🙂 Who knows will understand :p

Sometimes I have to deal with alien servers. Those are servers which were initially setup not by me. Of course, I can install things properly and they couldn’t :). So I have to fix and fix whatever they have done.

Naturally, it’s just always better to wipe things clean and start fresh with the Citrus Stack, but..

Some clients just want immediate fix

Alien setups (your setup, if you read this) have all kind of memory related issues. Mainly, your server reaches OOM state and things just stop working now and then. You want want immediate fix. So we need to run some tests to see if the server configuration can’t handle traffic (most common reason for OOM):

yum install httpd-tools

We need this to have ApacheBench installed. We use this to stress test our backend like this:

ab -n 500 -c 100 -H "Accept-Encoding: gzip,deflate" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Chrome/41.0.2228.0 Safari/537.36" https://example.com/

We are passing Chrome-like user agent string. This is to deal with PHP frameworks which try to evade things and detect testing utilities, then block them or otherwise ignore. We want to know whether any kind of traffic will slow down or kill the server.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.