Not logged in. · Lost password · Register
Forum: General Help and Support General Stuff RSS
Page creating 60-70 httpd threads
vicentiu #1
Member for a month · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: Page creating 60-70 httpd threads
Hello,

I have certain pages for which the Apache server creates 60-70 httpd threads and a few accesses can easily max out the connections in use at 256 and webserver becomes slow to respond.

Here are a couple of pages that are causing this:

https://reference.digilentinc.com/learn/instrumentation/tu…
https://reference.digilentinc.com/reference/soft…?redire…

Are we doing something wrong in how the pages are written?
Is there a way to minimize the number of connections even on such pages.

thanks

Vicentiu
Avatar
andi (Administrator) #2
User title: splitbrain
Member since May 2006 · 3538 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I only tried the first page. It is loading *a lot* of images. Each images is another request to Apache and PHP. However the responses to these image requests are very very slow and I am not sure why that is. Do you have any plugins installed that might interfere? Can you tell us more about your setup?
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
vicentiu #3
Member for a month · 6 posts
Group memberships: Members
Show profile · Link to this post
We seem to be undergoing some type of ddos right now and the investigation is ongoing, hence the slowness.

I was hoping to alleviate the situation if there was a way to not have a new connection for each image.
Are the number of images unreasonably high?
I think they have 60-70 images and that's about the number of new connections that I see, but the server maxes out at 256 connections.

Thanks
Avatar
andi (Administrator) #4
User title: splitbrain
Member since May 2006 · 3538 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
It's a lot but not unreasonable. You may want to look into the xsendfile option (https://www.dokuwiki.org/config:xsendfile) to improve static file delivery.

Again, the more details you can give us the better we may help you. Eg. are you using fpm? Is it a linux host? What PHP version is this? Are there any other specialities (virtualizing, docker, NAS, proxies, firewalls, ...)?
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
vicentiu #5
Member for a month · 6 posts
Group memberships: Members
Show profile · Link to this post
AWS EC2 instance (8GB, 2 cores) running with a load balancer in front of it for rate limiting and blocking some user agents from a previous dDOS.
Distribution: Amazon Linux AMI release 2018.03
PHP 5.6.40

What is fpm?

thank you
Avatar
andi (Administrator) #6
User title: splitbrain
Member since May 2006 · 3538 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hmm rate limiting? What exactly are the rules for that?
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
andi (Administrator) #7
User title: splitbrain
Member since May 2006 · 3538 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Oh I also recommend upgrading the PHP release for much better performance.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
vicentiu #8
Member for a month · 6 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #6
Quote by andi:
Hmm rate limiting? What exactly are the rules for that?

After 350 requests in a five-minute period, it blocks the ip for a little while.
vicentiu #9
Member for a month · 6 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #7
Quote by andi on 2020-02-21, 15:23:
Oh I also recommend upgrading the PHP release for much better performance.

Can you recommend a guide for upgrading?
Is it as simple as uninstalling 5.6 packages and installing 7.3 packages?

thanks
Avatar
andi (Administrator) #10
User title: splitbrain
Member since May 2006 · 3538 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Sorry I don't know Amazon's Linux well enough. If you have 7x packages, then yes upgrading to those is probably enough. But my guess is that you need to use a newer AMI.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
vicentiu #11
Member for a month · 6 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #8
Quote by vicentiu on 2020-02-21, 17:37:
Quote by andi:
Hmm rate limiting? What exactly are the rules for that?

After 350 requests in a five-minute period, it blocks the ip for a little while.

We were under a dDOS attack from 1300+ IPs from a /18 network, each one making no more than 2 requests each.

So much for rate limiting.

Once we filtered the IP range, everything got quiet and the webserver was happy again.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-04-02, 22:03:03 (UTC +02:00)