Rugby eating CPU time :-(
[1/2] from: petr:krenzelok:trz:cz at: 22-Nov-2001 12:58
Hi,
so, I set-up Rugby service to see its performance, and to find out, if
problem of rebol process eating cpu time is only Graham's experience.
Sadly it isn't:
asko 27390 41.9 8.7 6588 5548 ? R 10:26 42:03 rebolcmd
-cs game-server.cgi
I am connected to the server as the only one user, and I was logged out,
even though I have set "keep on". So I looked at Linux server console
and found out above .... that's bad - is it rebol, rugby, or is it
go-rim problem?
PS: the usage is rising as I type - 45% of CPU time now ...
strace shows following:
wait4(-1, NULL, WNOHANG, NULL) = 0
gettimeofday({1006428117, 913218}, NULL) = 0
select(12, [8 10 11], [], NULL, {0, 0}) = 0 (Timeout)
gettimeofday({1006428117, 942964}, NULL) = 0
wait4(-1, NULL, WNOHANG, NULL) = 0
gettimeofday({1006428117, 943771}, NULL) = 0
select(12, [8 10 11], [], NULL, {0, 0}) = 0 (Timeout)
gettimeofday({1006428117, 973394}, NULL) = 0
wait4(-1, NULL, WNOHANG, NULL) = 0
gettimeofday({1006428117, 974348}, NULL) = 0
select(12, [8 10 11], [], NULL, {0, 0}) = 0 (Timeout)
gettimeofday({1006428118, 3736}, NULL) = 0
wait4(-1, NULL, WNOHANG, NULL) = 0
gettimeofday({1006428118, 4524}, NULL) = 0
select(12, [8 10 11], [], NULL, {0, 0}) = 0 (Timeout)
gettimeofday({1006428118, 35616}, NULL) = 0
wait4(-1, NULL, WNOHANG, NULL) = 0
gettimeofday({1006428118, 36406}, NULL) = 0
select(12, [8 10 11], [], NULL, {0, 0}) = 0 (Timeout)
sometimes even:
old_mmap(NULL, 983040, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x4013c000
munmap(0x4031a000, 983040) = 0
gettimeofday({1006428273, 33450}, NULL) = 0
wait4(-1, NULL, WNOHANG, NULL) = 0
gettimeofday({1006428273, 34585}, NULL) = 0
select(12, [8 10 11], [], NULL, {0, 0}) = 0 (Timeout)
old_mmap(NULL, 983040, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x4022c000
or during connection:
select(12, [8 10 11], [], NULL, {0, 0}) = 1 (in [10], left {0, 0})
accept(10, {sin_family=AF_INET, sin_port=htons(61119),
sin_addr=inet_addr("195.47.26.26")}}, [16]) = 13
getsockname(13, {sin_family=AF_INET, sin_port=htons(8006),
sin_addr=inet_addr("195.47.26.65")}}, [16]) = 0
ioctl(13, FIONBIO, [1]) = 0
53.1 %CPU usage and rising .... shutting down gorim server ....
-pekr-
[2/2] from: petr::krenzelok::trz::cz at: 22-Nov-2001 13:46
I think it is rugby or rebol fault now:
I set-up simple cgi-script:
#!/usr/bin/rebolcmd -c
REBOL []
do %rugby.r
print "Content-type: text/plain"
print newline
print "Starting simple Rugby echo test service, stop your browser loading
the page ..."
serve/with-http [echo] tcp://:9005
Then I did following in my rebol PC console (not server running the
service):
->> do %/F/vymena/rebOL/rugby/rugby.r
->> do get-rugby-service/http http://www.rebol.cz:9005
->> start: now/Time loop 100 [echo/http "Tralala"] print now/Time - start
0:02:46
resulting in:
asko 28184 44.1 7.5 5820 4776 ? R 12:45 13:09 rebolcmd -c
rugby-echo.cgi
44.1 CPU usage ...
Not doing anything now and it is now 50.1%, as I type ...
Now what? OK, I will start the service and will NOT connect to it. I will
let it run on server and observe ...
Cheers,
-pekr-