High Requests causing site unsuitability

I have a very basic webserver running ubuntu/apache/php (1GB ram, 1cpu) that handles my max ~30 active users pretty well with avg load < .25 for my site (actionfigure411.com). I’m testing CloudFlare and as soon as I switch the DNS, it 2x/3x my connections (as seen in Apache) it cause a downstream effect of increasing memory, swap kicks on and it’s a beautiful mess of request time outs.

Granted, if I had more memory, I could probably sustain more active connections, but I’m trying to avoid increasing my server footprint by offloading to a CDN :slight_smile:

I have it somewhat stable now, but I still see fluctuations in stability as if CF is storming my server. I created a simple log script to capture stats every minute to show you the difference.

Without CloudFlare

02:37:01 PM 0.12 19/79 795mb 42mb 0.081227s
02:38:01 PM 0.04 22/64 940mb 43mb 0.033663s
02:39:02 PM 0.01 17/91 721mb 42mb 0.308486s !
02:40:01 PM 0.19 18/86 862mb 50mb 0.033465s
02:41:01 PM 0.18 14/83 653mb 47mb 0.024369s
02:42:02 PM 0.35 15/83 820mb 55mb 0.089965s
02:43:01 PM 0.14 17/65 830mb 49mb 0.028108s
02:44:01 PM 0.05 16/61 852mb 53mb 0.025831s
02:45:01 PM 0.56 17/89 901mb 53mb 0.055001s

Conn: # Apache Workers/netstat :443
ps -ylC apache2 | awk ‘{x += $8;y += 1} END {printf y-1;}’
netstat -ant | grep -E ‘:80|:443’ | wc -l
AMEM: Size of memory in Apache. over 1GB will swap to disk
ps -ylC apache2 | awk '{x += $8;y += 1} END {printf x/1024;}
APER: Avg size of each Apache process (total memory used/# of workers)
ps -ylC apache2 | awk ‘{x += $8;y += 1} END {printf x/((y-1)*1024);}’
HP: curl of homepage
curl -o /dev/null -s -w ‘%{time_total}’ https://www.actionfigure411.com

Apache Server Status shows (as an example):

where a period is an open slot if you’re familiar with apache’s server status. Each letter/symbol represents a potential process and I have my server configured to 75 max. Basically the site is running well without any issues processing new requests.

However, with CF enabled I see floods of connections maxing out my 75 available and Apache will show:

or just all K’s which means it’s keeping the connection active. I see my homepage test go above 10s and ultimately lock up the site as waiting connections can not be serviced.

With CloudFlare

|05:08:01 PM | 0.06 | 19/246 | 745 mb | 39mb | 0.065162s
|05:09:02 PM | 0.02 | 17/465 | 690 mb | 41mb | 0.079610s | |
|05:10:14 PM | 0.00 | 75/635 | 1757mb | 23mb | 13.552871s | M!P!W!|
|05:11:01 PM | 0.45 | 51/781 | 1743mb | 34mb | 0.071482s | M!|
|05:12:02 PM | 1.28 | 69/1292 | 2336mb | 34mb | 0.081363s | C!M!|
|05:13:06 PM | 0.47 | 60/587 | 1740mb | 29mb | 5.176871s | M!W!|
|05:14:02 PM | 0.60 | 55/1822 | 2141mb | 39mb | 0.057760s | M!|

Any thoughts?

Is Cloudflare allowed to connect to your origin host / server?
Furthermore, kindly re-check if Cloudflare is allowed to connect to your origin host to as follows in the below article:

Nevertheless, Cloudflare IP addresses list can be found here:

Also, have you configured your Apache to return the Real Visitor IP Address? The instructions can be found at the below article:

It is connecting. The Analytics page show assets are starting to be cached and I spot tested a few things using redbot.org and I can see the HIT that it was coming from CF’s cache.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.