Make web interface faster using http KeepAlive

e100

Renowned Member
Nov 6, 2010
1,268
47
88
Columbus, Ohio
ulbuilder.wordpress.com
The slowness of the AJAX web interface was starting to annoy me so I started digging into why it is slow.

First thing I find is that KeepAlive in apache is turned off.

/etc/apache2/sites-enabled/pve.conf:
Code:
# But KeepAlive spawns too many processes - so we disable that for now
KeepAlive off

So I changed it to on, restarted apache, much better performance of the web interface.
A few more process for much better performance seems like a perfect trade to me.

Can this be changed to have KeepAlive enabled by default?

If anyone else wants to give this a try, I used this command on all of my servers to make the change:
Code:
sed -i 's/KeepAlive off/KeepAlive on/g' /etc/apache2/sites-available/pve.conf && service apache2 restart
 
Last edited:
can you define "slow" - how do you measure?
 
Clicking on tabs or different VMs take longer for the page to render when KeepAlive is off.
I did not use anything to measure other than counting seconds in my head.

On a local lan the difference might not be noticeable.

But going through a couple of firewalls over a VPN to get to the web GUI there is a little more latency involved.
With KeepAlive off each request will require opening a new TCP Connection.
Once the TCP connection is established now we have to perform an SSL handshake.

With KeepAlive on, the TCP Connection setup can happen once and the SSL handshake can also happen once.
Subsequent requests will then happen with less latency.
 
With KeepAlive on, the TCP Connection setup can happen once and the SSL handshake can also happen once.
Subsequent requests will then happen with less latency.

I will do more test next week to see how that influence the number of apache processes.