I'm trying to configure a load balancing system. I've a python script, invoked through mod_wsgi on Apache, that generates a query and executes it on pgpool: request-> wsgi python -> pgpool -> postgresql. Pgpool is configured as load balancer using 4 servers with 24GB ram and 350GB ssh hd. Our db is about 150GB and a query takes about 2 seconds. These are the configurations:
Pgpool
- num_init_children 500
- max_pool 2
- child_life_time 300 seconds
Apache (mpm_prefork)
- StartServers 100
- MinSpareServers 20
- MaxSpareServers 45
- ServerLimit 2000
- MaxClients 100
- MaxRequestsPerChild 1000
PostgreSQL
- max_connections = 1000
- shared_buffers = 6GB
- work_mem = 4GB
It seems not working When I try to submit more than 150 concurrent queries, although pgpool log file doesn't have any errors I get this error from the python script:
OperationalError: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.
Any ideas?