Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What are some different ways/tools to verify that keep-alive is working on the server from the client's end?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You could try

ab -n 500 -c 5 -k http://www.domain.com/

and look via top, if 5 workers are constantly serving the requests keepalive should work (-k) switch. Do the same without -k and see the difference.

Cheers Izac

share|improve this answer
    
that's what i wound up doing, though i read that curl can tell you this too. if it says "Connection #0 to host www.example.com left intact", it means keep-alive is on. –  Ron Garrity Aug 26 '11 at 20:53

As Ron Garrity says, you can use Curl like this:

curl -Iv http://www.aptivate.org 2>&1 | grep -i 'connection #0'

And it outputs these two lines if keep-alive is working:

* Connection #0 to host www.aptivate.org left intact
* Closing connection #0

And if keep-alive is not working, then it just outputs this line:

* Closing connection #0
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.