Re: Download speed throttling based on file size?
"Geoff Mayes" <[email protected]>
| Newsgroups | gmane.comp.web.fastcgi.devel,gmane.spam.detected |
|---|---|
| Message-ID | <[email protected]> |
Hi David, Thank you very much for your input on the matter. I initially thought that the rate limiting behavior based on file size was being handled by the app (MoinMoin wiki) and so I posted to their mailing list. Another user stated that he experiences the same behavior, but that he believes the behavior comes from fastcgi. I originally thought he was right, then questioned myself, and now still think the source for the behavior is fastcgi because I just switched MoinMoin to plain, old CGI and the files constantly downloaded at 1.5Mb/s. I guess, however, that it still could be MoinMoin's implementation of fastcgi. I ran four straces twice: one set of four while mod_rewrite was rewriting a 112MB file to Apache and the second set while mod_rewrite was pushing all requests through the moin.fcg process. For all straces, I followed this sequence: navigated to the page "gmayes", clicked the "attachments" link, and then clicked the "get" link to download the file. The straces on the parent httpd processes and the /usr/sbin/fcgi- processes outputted nothing. The straces on the child httpd processes and the "python /wiki/server/moin.fcg" processes provided some information. I'm not certain what to look for, so any comments are very welcome (e.g. did I even strace on the right processes?). Straces are attached, as well as the moin.fcg file which handles all incoming requests for the wiki. > If your application knows the size of the file beforehand, is there any > chance that it has to do with the memory is being allocated/managed? I wish I knew the internals of MoinMoin better so that I could answer this question. Because this app over cgi downloads at constant, high speeds, would it be unusual for the app to change this behavior for fastcgi? Many thanks, Geoff > -----Original Message----- > From: David Birnbaum [mailto:[email protected]] > Sent: Saturday, July 21, 2007 4:18 AM > To: Geoff Mayes > Cc: [email protected] > Subject: Re: [FASTCGI] Download speed throttling based on file size? > > Geoff, > > I've never heard of such a thing - I'd be curious to see if a truss or > strace on > either the fastcgi or http server shows anything. > > If your application knows the size of the file beforehand, is there any > chance > that it has to do with the memory is being allocated/managed? > > David. > > ----- > > On Fri, 20 Jul 2007, Geoff Mayes wrote: > > > Hello, > > > > Does fastcgi rate limit file downloads based on their size? I'm running > the > > MoinMoin wiki on fastcgi and different file sizes download at different > > speeds. 240MB, 140MB, and 40MB files download at 3, 6, and 20Kb/s, > > respectively. As there is less of the file to download, the download > speed > > increases. For example, when there are only 20MB left of the 40MB file, > it > > downloads at 40Kb/s, and when only 3MB are left, it downloads at > ~300Kb/s. > > > > - I've verified the same behavior in mod_fcgid. > > - Downloading via Apache without fastcgi results in constant high > download > > speeds (~1.5Mb/s). > > > > Is there a way to turn off this rate limiting or configure it somehow? > > > > Many thanks, > > Geoff > > ___________________________________ > > fastcgi-developers mailing list > > http://fastcgi.com/fastcgi-developers/ > > ___________________________________ fastcgi-developers mailing list http://fastcgi.com/fastcgi-developers/
httpdchild-with-rewrite.txt
(text/plain, 11.1 KB)
semop(68943879, 0x9ea70c, 1) = 0
epoll_wait(12, {{EPOLLIN, {u32=153669288, u64=13826552078864535208}}}, 2, -1) = 1
accept(5, {sa_family=AF_INET6, sin6_port=htons(45125), inet_pton(AF_INET6, "::ffff:10.16.65.250", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 14
semop(68943879, 0x9ea712, 1) = 0
getsockname(14, {sa_family=AF_INET6, sin6_port=htons(443), inet_pton(AF_INET6, "::ffff:10.17.73.206", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 0
time(NULL) = 1185224047
fcntl64(14, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(14, F_SETFL, O_RDWR|O_NONBLOCK) = 0
time(NULL) = 1185224047
read(14, "\26\3\0\0c\1\0\0_\3\0\0\t1Vi\177\212;$\375\231C\234Z\240"..., 8000) = 104
time(NULL) = 1185224047
semop(68714497, 0x9ea70c, 1) = 0
time(NULL) = 1185224047
time(NULL) = 1185224047
time(NULL) = 1185224047
semop(68714497, 0x9ea712, 1) = 0
time(NULL) = 1185224047
time(NULL) = 1185224047
writev(14, [{"\26\3\0\0J\2\0\0F\3\0F\245\25o\26\0i\325;\313\372\250\264"..., 154}], 1) = 154
poll([{fd=14, events=POLLIN, revents=POLLIN}], 1, 120000) = 1
read(14, "\24\3\0\0\1\1\26\3\0\0@OgE3\3\314;\332\31\317(\270\351"..., 8000) = 656
gettimeofday({1185224047, 476843}, NULL) = 0
gettimeofday({1185224047, 477089}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 160) = 160
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 478166}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 164) = 164
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 479186}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 162) = 162
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 480209}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 163) = 163
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 481247}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 167) = 167
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 482222}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 162) = 162
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 483205}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 156) = 156
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 484181}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 214) = 214
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 485141}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 156) = 156
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 486106}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 165) = 165
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 487153}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 161) = 161
semop(68780034, 0x9ea712, 1) = 0
stat64("/wiki", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
gettimeofday({1185224047, 488562}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 161) = 161
semop(68780034, 0x9ea712, 1) = 0
stat64("/wiki/server/moin.fcg/gmayes", 0xbfe1c50c) = -1 ENOTDIR (Not a directory)
lstat64("/wiki", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/wiki/server", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/wiki/server/moin.fcg", {st_mode=S_IFREG|0755, st_size=1644, ...}) = 0
open("/wiki/server/moin.fcg", O_RDONLY|O_LARGEFILE) = 15
read(15, "#!/usr/bin/env python\n# -*- codi"..., 4096) = 1644
close(15) = 0
gettimeofday({1185224047, 491577}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 159) = 159
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 492554}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 163) = 163
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 493521}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 161) = 161
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 494501}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 162) = 162
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 495455}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 166) = 166
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 496409}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 161) = 161
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 497367}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 155) = 155
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 498338}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 196) = 196
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 499299}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 155) = 155
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 500253}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 164) = 164
semop(68780034, 0x9ea712, 1) = 0
gettimeofday({1185224047, 501207}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 160) = 160
semop(68780034, 0x9ea712, 1) = 0
stat64("/wiki", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
gettimeofday({1185224047, 502538}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(68780034, 0x9ea70c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:13"..., 160) = 160
semop(68780034, 0x9ea712, 1) = 0
stat64("/wiki/server/moin.fcg/gmayes", 0xbfe1c00c) = -1 ENOTDIR (Not a directory)
lstat64("/wiki", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/wiki/server", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/wiki/server/moin.fcg", {st_mode=S_IFREG|0755, st_size=1644, ...}) = 0
open("/wiki/server/moin.fcg", O_RDONLY|O_LARGEFILE) = 15
read(15, "#!/usr/bin/env python\n# -*- codi"..., 4096) = 1644
close(15) = 0
socket(PF_FILE, SOCK_STREAM, 0) = 15
connect(15, {sa_family=AF_FILE, path="/tmp/fcgi_ipc/4f298576857ddb0f6e48fd7cf49838d4"}, 48) = 0
fcntl64(15, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(15, F_SETFL, O_RDWR|O_NONBLOCK) = 0
select(16, [15], [15], NULL, {30, 0}) = 1 (out [15], left {30, 0})
write(15, "\1\1\0\1\0\10\0\0\0\1\0\0\0\0\0\0\1\4\0\1\0\23\0\0\n\7"..., 1509) = 1509
select(16, [15], [], NULL, {30, 0}) = 1 (in [15], left {29, 992000})
read(15, "\1\6\0\1\16\242\6\0Vary: Cookie,User-Agent,"..., 8192) = 3760
select(16, [15], [], NULL, {0, 100000}) = 1 (in [15], left {0, 95000})
read(15, "\1\6\0\1\f\235\3\0\n<body lang=\"en\" dir=\"l"..., 8192) = 3240
select(16, [15], [], NULL, {0, 100000}) = 1 (in [15], left {0, 93000})
read(15, "\1\6\0\1\16/\1\0<div id=\"content\">\n<h2>A"..., 8192) = 3640
writev(14, [{"\27\3\0\0\360\345q\223\31B\244\327\201M0\343CW\350\25\272"..., 282}, {"\27\3\0 \22\371P\356g8\240\326\313\201P\0014\271,\212"..., 8229}], 2) = 8511
select(16, [15], [], NULL, {30, 0}) = 1 (in [15], left {30, 0})
readv(15, [{"\1\6\0\1\0\0\0\0\"/TitleIndex\">\n<link rel"..., 4552}, {"\1\6\0\1\16/\1\0<div id=\"content\">\n<h2>A"..., 1307}], 2) = 8
select(16, [15], [], NULL, {0, 100000}) = 1 (in [15], left {0, 100000})
read(15, "\1\3\0\1\0\10\0\0\0\0\0\0\0\0\0\0", 8192) = 16
fcntl64(15, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK)
fcntl64(15, F_SETFL, O_RDWR) = 0
setsockopt(15, SOL_SOCKET, SO_LINGER, {onoff=0, linger=0}, 8) = 0
close(15) = 0
writev(14, [{"\27\3\0\0 \317\24B\276(\375\260\307\4\314\260\276Q\322"..., 2484}], 1) = 2484
writev(14, [{"\27\3\0\0 m\223|\217*\251n\205\304BbF6\2221\35\6\304\337"..., 37}], 1) = 37
write(10, "10.16.65.250 - - [23/Jul/2007:13"..., 234) = 234
writev(14, [{"\25\3\0\0 \5k0\221\356\370\370\271f\370\267\26q\304\202"..., 37}], 1) = 37
shutdown(14, 1 /* send */) = 0
poll([{fd=14, events=POLLIN, revents=POLLIN|POLLHUP}], 1, 2000) = 1
read(14, "", 512) = 0
close(14) = 0
read(7, 0xbfe1c793, 1) = -1 EAGAIN (Resource temporarily unavailable)
semop(68943879, 0x9ea70c, 1) = 0
epoll_wait(12, <unfinished ...>
httpdchild-without-rewrite.txt
(text/plain, 8.8 KB)
semop(69238791, 0x2a670c, 1) = 0
epoll_wait(12, {{EPOLLIN, {u32=157858912, u64=13819520427131190368}}}, 2, -1) = 1
accept(5, {sa_family=AF_INET6, sin6_port=htons(52955), inet_pton(AF_INET6, "::ffff:10.16.65.250", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 14
semop(69238791, 0x2a6712, 1) = 0
getsockname(14, {sa_family=AF_INET6, sin6_port=htons(443), inet_pton(AF_INET6, "::ffff:10.17.73.206", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 0
time(NULL) = 1185225153
fcntl64(14, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(14, F_SETFL, O_RDWR|O_NONBLOCK) = 0
time(NULL) = 1185225153
read(14, "\26\3\0\0c\1\0\0_\3\0\0\t5\2478\372\1s\357e:\354\376\21"..., 8000) = 104
time(NULL) = 1185225153
semop(69009409, 0x2a670c, 1) = 0
time(NULL) = 1185225153
time(NULL) = 1185225153
time(NULL) = 1185225153
semop(69009409, 0x2a6712, 1) = 0
time(NULL) = 1185225153
time(NULL) = 1185225153
writev(14, [{"\26\3\0\0J\2\0\0F\3\0F\245\31\301\311\262!\375\360\300"..., 154}], 1) = 154
poll([{fd=14, events=POLLIN, revents=POLLIN}], 1, 120000) = 1
read(14, "\24\3\0\0\1\1\26\3\0\0@\264\305ZYVE\201|Q\315\323\344\214"..., 8000) = 656
gettimeofday({1185225153, 137916}, NULL) = 0
gettimeofday({1185225153, 138166}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 160) = 160
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 139265}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 164) = 164
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 140226}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 162) = 162
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 141265}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 163) = 163
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 142232}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 156) = 156
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 143205}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 165) = 165
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 144199}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 161) = 161
semop(69074946, 0x2a6712, 1) = 0
stat64("/wiki", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
gettimeofday({1185225153, 145499}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 161) = 161
semop(69074946, 0x2a6712, 1) = 0
stat64("/wiki/server/moin.fcg/gmayes", 0xbfc8c9cc) = -1 ENOTDIR (Not a directory)
lstat64("/wiki", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/wiki/server", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/wiki/server/moin.fcg", {st_mode=S_IFREG|0755, st_size=1644, ...}) = 0
open("/wiki/server/moin.fcg", O_RDONLY|O_LARGEFILE) = 15
read(15, "#!/usr/bin/env python\n# -*- codi"..., 4096) = 1644
close(15) = 0
gettimeofday({1185225153, 148589}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 159) = 159
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 149571}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 163) = 163
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 150556}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 161) = 161
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 151546}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 162) = 162
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 152597}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 155) = 155
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 153572}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 164) = 164
semop(69074946, 0x2a6712, 1) = 0
gettimeofday({1185225153, 154587}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 160) = 160
semop(69074946, 0x2a6712, 1) = 0
stat64("/wiki", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
gettimeofday({1185225153, 155885}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
semop(69074946, 0x2a670c, 1) = 0
write(11, "10.16.65.250 - - [23/Jul/2007:14"..., 160) = 160
semop(69074946, 0x2a6712, 1) = 0
stat64("/wiki/server/moin.fcg/gmayes", 0xbfc8c4cc) = -1 ENOTDIR (Not a directory)
lstat64("/wiki", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/wiki/server", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat64("/wiki/server/moin.fcg", {st_mode=S_IFREG|0755, st_size=1644, ...}) = 0
open("/wiki/server/moin.fcg", O_RDONLY|O_LARGEFILE) = 15
read(15, "#!/usr/bin/env python\n# -*- codi"..., 4096) = 1644
close(15) = 0
socket(PF_FILE, SOCK_STREAM, 0) = 15
connect(15, {sa_family=AF_FILE, path="/tmp/fcgi_ipc/4f298576857ddb0f6e48fd7cf49838d4"}, 48) = 0
fcntl64(15, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(15, F_SETFL, O_RDWR|O_NONBLOCK) = 0
select(16, [15], [15], NULL, {30, 0}) = 1 (out [15], left {30, 0})
write(15, "\1\1\0\1\0\10\0\0\0\1\0\0\0\0\0\0\1\4\0\1\0\23\0\0\n\7"..., 1509) = 1509
select(16, [15], [], NULL, {30, 0}) = 1 (in [15], left {29, 992000})
read(15, "\1\6\0\1\16\242\6\0Vary: Cookie,User-Agent,"..., 8192) = 3760
select(16, [15], [], NULL, {0, 100000}) = 1 (in [15], left {0, 95000})
read(15, "\1\6\0\1\f\235\3\0\n<body lang=\"en\" dir=\"l"..., 8192) = 3240
select(16, [15], [], NULL, {0, 100000}) = 1 (in [15], left {0, 93000})
read(15, "\1\6\0\1\16/\1\0<div id=\"content\">\n<h2>A"..., 8192) = 3664
writev(14, [{"\27\3\0\0\360\36I\221\22.\336\nD%\255}\f\254\305\355J~"..., 282}, {"\27\3\0 \31741\274\266\250\204\275dJhO\322Dt4\201\34\10"..., 8229}], 2) = 8511
select(16, [15], [], NULL, {30, 0}) = 1 (in [15], left {30, 0})
readv(15, [{"link rel=\"Glossary\" href=\"/WordI"..., 4528}, {"\1\6\0\1\16/\1\0<div id=\"content\">\n<h2>A"..., 1307}], 2) = 0
fcntl64(15, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK)
fcntl64(15, F_SETFL, O_RDWR) = 0
setsockopt(15, SOL_SOCKET, SO_LINGER, {onoff=0, linger=0}, 8) = 0
close(15) = 0
writev(14, [{"\27\3\0\0 \304*Lxb\230v\273lQ\342\t\33j4a\20\312\242G\16"..., 2484}], 1) = 2484
writev(14, [{"\27\3\0\0 g\235\362\333\256\213\343nM\330<\254\216\214"..., 37}], 1) = 37
write(10, "10.16.65.250 - - [23/Jul/2007:14"..., 234) = 234
writev(14, [{"\25\3\0\0 9\32R\357t3\243\240\220\245/\226qq\200*{\34\274"..., 37}], 1) = 37
shutdown(14, 1 /* send */) = 0
poll([{fd=14, events=POLLIN, revents=POLLIN|POLLHUP}], 1, 2000) = 1
read(14, "", 512) = 0
close(14) = 0
read(7, 0xbfc8cc53, 1) = -1 EAGAIN (Resource temporarily unavailable)
semop(69238791, 0x2a670c, 1) = 0
epoll_wait(12, <unfinished ...>
moin.fcg-with-rewrite.txt
(text/plain, 2.2 KB)
accept(3, {sa_family=AF_FILE, path=@}, [2]) = 4
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
futex(0x9c66a50, FUTEX_WAKE, 1) = 0
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
futex(0x9b068c0, FUTEX_WAKE, 1) = 0
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
close(6) = 0
munmap(0xb7f86000, 4096) = 0
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
futex(0x9c66a50, FUTEX_WAKE, 1) = 0
clone(child_stack=0xb7e924b4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb7e92bd8, {entry_number:6, base_addr:0xb7e92b90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb7e92bd8) = 6472
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
select(0, NULL, NULL, NULL, {0, 0}) = 0 (Timeout)
futex(0x9b0bb80, FUTEX_WAIT, 0, NULL) = 0
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
futex(0x9c66a50, FUTEX_WAKE, 1) = 0
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
accept(3, {sa_family=AF_FILE, path=@}, [2]) = 5
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
futex(0x9c66a50, FUTEX_WAKE, 1) = 0
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
futex(0x9b0bb68, FUTEX_WAKE, 1) = 0
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
close(7) = 0
munmap(0xb7f85000, 4096) = 0
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
futex(0x9c66a50, FUTEX_WAKE, 1) = 0
clone(child_stack=0xb7e924b4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb7e92bd8, {entry_number:6, base_addr:0xb7e92b90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb7e92bd8) = 6473
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
select(0, NULL, NULL, NULL, {0, 0}) = 0 (Timeout)
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
futex(0x9c66a50, FUTEX_WAKE, 1) = 0
futex(0x9b0bb80, FUTEX_WAKE, 1) = 0
accept(3, <unfinished ...>
moin.fcg-without-rewrite.txt
(text/plain, 3.1 KB)
accept(3, {sa_family=AF_FILE, path=@}, [2]) = 4
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x89bba50, FUTEX_WAKE, 1) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x8860b68, FUTEX_WAKE, 1) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x89bba50, FUTEX_WAKE, 1) = 0
clone(child_stack=0xb7e9e4b4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb7e9ebd8, {entry_number:6, base_addr:0xb7e9eb90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb7e9ebd8) = 6562
futex(0x8860b80, FUTEX_WAKE, 1) = 0
select(0, NULL, NULL, NULL, {0, 0}) = 0 (Timeout)
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x89bba50, FUTEX_WAKE, 1) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
accept(3, {sa_family=AF_FILE, path=@}, [2]) = 5
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x89bba50, FUTEX_WAKE, 1) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x885b8c0, FUTEX_WAKE, 1) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
close(6) = 0
munmap(0xb7f92000, 4096) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x89bba50, FUTEX_WAKE, 1) = 0
clone(child_stack=0xb7e9e4b4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb7e9ebd8, {entry_number:6, base_addr:0xb7e9eb90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb7e9ebd8) = 6563
futex(0x8860b80, FUTEX_WAKE, 1) = 0
select(0, NULL, NULL, NULL, {0, 0}) = 0 (Timeout)
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x89bba50, FUTEX_WAKE, 1) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
accept(3, {sa_family=AF_FILE, path=@}, [2]) = 4
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x89bba50, FUTEX_WAKE, 1) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x8860b68, FUTEX_WAKE, 1) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
close(7) = 0
munmap(0xb7f91000, 4096) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x89bba50, FUTEX_WAKE, 1) = 0
clone(child_stack=0xb7e9e4b4, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0xb7e9ebd8, {entry_number:6, base_addr:0xb7e9eb90, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}, child_tidptr=0xb7e9ebd8) = 6565
futex(0x8860b80, FUTEX_WAKE, 1) = 0
select(0, NULL, NULL, NULL, {0, 0}) = 0 (Timeout)
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
futex(0x89bba50, FUTEX_WAKE, 1) = 0
futex(0x8860b80, FUTEX_WAKE, 1) = 0
accept(3, <unfinished ...>
moin.fcg.txt
(text/plain, 1.7 KB)
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - FastCGI Driver Script
@copyright: 2004-2005 by Oliver Graf <[email protected]>
@license: GNU GPL, see COPYING for details.
"""
# System path configuration
import sys
# Path to MoinMoin package, needed if you installed with --prefix=PREFIX
# or if you did not use setup.py.
## sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
# Path of the directory where wikiconfig.py is located.
# YOU NEED TO CHANGE THIS TO MATCH YOUR SETUP.
sys.path.insert(0, '/wiki')
# Path of the directory where farmconfig is located (if different).
## sys.path.insert(0, '/path/to/farmconfig')
# Debug mode - show detailed error reports
import os
os.environ['MOIN_DEBUG'] = '1'
# how many requests shall be handled by a moin fcgi process before it dies,
# -1 mean "unlimited lifetime":
max_requests = -1
# how many threads to use (1 means use only main program, non-threaded)
max_threads = 5
# backlog, use in socket.listen(backlog) call
backlog = 5
# Code ------------------------------------------------------------------
# Do not touch unless you know what you are doing!
# TODO: move to server package?
# Set threads flag, so other code can use proper locking
from MoinMoin import config
config.use_threads = max_threads > 1
del config
from MoinMoin.request import RequestFastCGI
from MoinMoin.support import thfcgi
def handle_request(req, env, form):
request = RequestFastCGI(req, env, form)
request.run()
if __name__ == '__main__':
fcg = thfcgi.FCGI(handle_request, max_requests=max_requests, backlog=backlog, max_threads=max_threads)
fcg.run()