I want to figure out how gwan responds if a script takes longer than 1 second to finish.
To do so, I used the sleep()
function in the hello.c
example:
#include "gwan.h"
#include <unistd.h>
int main(int argc, char **argv)
{
sleep(5);
static char msg[] = "Hello, ANSI C!";
xbuf_ncat(get_reply(argv), msg, sizeof(msg) - 1);
return 200; // return an HTTP code (200:'OK')
}
The response time I got from Chrome was >= 5 seconds, as expected.
Then, I have run a Weighttp concurrency test, and here is the response time I got from Chrome in ms (millisecond).
Is this a caching issue? Where the 5 second sleep time has gone?
Thanks.