Open Dead2 opened 8 years ago
I think you can try this module by me: https://github.com/cfsego/nginx-limit-upstream/
however, I don't know whether it works well with you tengine, so tell me when you meet any problem
It seems like it needs some modification/updates to work with current tengine.
I also see that you have considered having it merged into tengine, and it seems like a good idea to me since this feature should be very useful. Is there any hope of that happening?
nginx has a max_conns parameter for each server in upstream, tengine does not seem to have this feature at all.
We are experiencing a reoccuring deadlock of the upstream server due to all connections being used by processes attempting to connect to itself (mod_pagespeed). The only proper way of avoiding this is to make tengine wait when too many connections are in use. Increasing the connection limit on upstream only makes the problem harder to trigger, but it unfortunately does not resolve the problem.
Ex: 300 connections running on 4 cores is horribly inefficient, having tengine limit the connections to upstream would increase performance due to reduced context-switching and avoid the potential out-of-memory situations that can occur with that many connections.