I currently have apache running with web2py on windows using mod_wsgi and python 2.7.10. What I've noticed is when I have concurrent connections, the response time per request increases. This increase may go from 20ms for 1 connection to 200ms for 5 concurrent connections. If I get up to 20 concurrent connections, I have a response time of 800ms - 1s for a request that is only 545 B.
Would adding a front end like nginx help resolve this or is there something that can be changed in the apache config?
My current apache config limits are:
Threadlimit 100
ThreadsPerChild 100
MaxRequestsPerChild 10000
AcceptFilter http none
AcceptFilter https none
KeepAlive On
The code that is being executed is:
Javascript:
$(function () {
function refresh(){
$.get('/database/domath_stuff', {num:document.getElementById('mathstuff').innerHTML}, function (response) {
document.getElementById('mathstuff').innerHTML = response
})
}
window.setInterval(refresh, 1000);
});
The python is:
def domath_stuff():
number = int(request.vars.num)
number = number + 1
return number