2

We recently converted our web site to https. After certificate installation and testing we created a 301 redirect in .htaccess. Things went fine for a few days with little apparent performance impact.

Day 3 or 4 we ran into OOM issues. Over the next few days we would see the same pattern repeated. At about 9:15 AM (when our server starts to see increased load) our memory usage would creep up and often cause the server to kill memcached or mysql. It's hard to understand because we'd see much much greater usage (per google analytics) later in the day with no problems at all.

Server Version: Apache/2.4.25 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 PHP/5.5.38 Server MPM: prefork Start servers: 10 Min spare servers: 5 server limit: 256 max request workers: 256 max connections per child: 2500* keep alive: on keep alive timeout: 1 

I lowered max connections because we noticed that the mem usage per child seemed to increase significantly during the problem period. Per htop RES for each child is usually 25000k. During stress it is over 50000k. So I had a thought that I wanted to increase the frequency new child processes being spawned. Unclear if this made any difference.

We've checked all cron jobs to ensure that nothing special is scheduled at the stress period.

Does adding ssl create significantly more mem usage for apache? Why only at this particular time - not even anywhere near our busiest time (although it might be the time that the usage grows the most).

Update. We removed the 301 redirect to try to definitively determine if this was the cause. Sure enough the server handled the 9:30am rush today without ever showing the slightest memory or cpu strain. So we still have https enabled - but not sure how our http vs https workloads differ atm.

Update 2. rewrite as requested

RewriteCond %{HTTPS} off RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L] 

(originally had 301 redirect - but took off pending solving memory issue)

4
  • Have you enabled http/2 on the server? Commented Apr 12, 2017 at 2:19
  • Nelson, no. TBH I'd never heard of it. I have to investigate more although a cursory search shows that it isn't directly supported in our Cpanel/WHM environment (which will entail custom configs to implement). Do the symptoms I describe sound consistent with lack of httpd2? Commented Apr 12, 2017 at 14:42
  • Please post your htaccess rewrite rule Commented Apr 12, 2017 at 17:52
  • added rewrite rule as request. It is located in DocRoot dir Commented Apr 13, 2017 at 15:01

1 Answer 1

0

William, https will definitely increase the overhead in the way Apache serve webpages, that's why I asked if you had enabled http/2 because http/2 is way more efficient in handling https requests...It will make your website a lot faster too with less performance customization needed.

Definitely look into that.

1
  • Thanks Nelson. I did look into a bit more. Seems like a sensible thing to do. I'm a little bound with Cpanel/WHM though as http/2 isn't supported in EasyApache4. Best regards Commented Apr 13, 2017 at 15:03

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.