logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Reverse proxy and back-end instances (threads & connecti
Author
cent2ap



Joined: 14 Sep 2020
Posts: 6

PostPosted: Mon 14 Sep '20 13:08    Post subject: Reverse proxy and back-end instances (threads & connecti Reply with quote

Hello everyone!

I would like your opinions about my configuration, how I can make it more robust and portable, so I can use the same settings with minimal modifications for different environments.

My setup uses a single front-end Apache acting as a reverse proxy and SSL/TLS end-point. The back-end is made out of multiple Apache instances, one per virtual host, listening on 127.0.0.1:xxxx (where xxxx is an incremental port number).

Code:

-> apache reverse proxy:443 (SSL/TLS SNI virtual hosts)
|
|---> apache instance:9001 (virtual host example1.tld)
|---> apache instance:9002 (virtual host example2.tld)
|---> apache instance:9003 (virtual host example3.tld)
|---> apache instance:9004 (virtual host example4.tld)
\---> apache instance:9005 (virtual host example5.tld)


My front-end apache reverse proxy runs with the default values:

Code:

ServerLimit 16
ThreadsPerChild 25
ThreadLimit 64
MaxRequestWorkers 400


So at this point, I'd appreciate your input. What should the back-end values look like, per apache instance/virtual host? Or if you prefer, what kind of algorithm should I use to generate the back-end values of the above configuration parameters?

Assumptions:
- Everything runs on the same server.
- The reverse proxy and all back-end instances run MPM event.
- All hosted websites are of similar size and usage requirements
- Almost all of them run Wordpress (php-fpm).
- Server memory varies from 1GB to 256GB.
- For CentOS 7, apache is httpd-2.4.6
- For CentOS 8, apache is httpd-2.4.37

Thank you!
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Tue 15 Sep '20 22:26    Post subject: Reply with quote

What method are you using so far?

mod_lbmethod_byrequests
mod_lbmethod_bytraffic
mod_lbmethod_bybusyness

See also https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html#scheduler
Back to top
cent2ap



Joined: 14 Sep 2020
Posts: 6

PostPosted: Tue 15 Sep '20 23:18    Post subject: Reply with quote

None of the above, because I am not doing any load balancing on my reverse proxy.

I use the following to make things work:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

The reverse proxy will terminate SSL/TLS and via SNI pick the right virtual host to forward the request to the equivalent back-end apache.
Back to top


Reply to topic   Topic: Reverse proxy and back-end instances (threads & connecti View previous topic :: View next topic
Post new topic   Forum Index -> Apache