From: Vodonosov A. <avo...@ya...> - 2007-12-11 14:39:29
|
Hi. Thank you for reply, Nicodemus. > On Dec 11, 2007 1:22 AM, Anton Vodonosov <avo...@ya...> wrote: > > But after several "ab -n 100 -c 10 MY_URL" > > sbcl and whole system are very-very slow > > (because of wild swapping). Some time after > > this linux kills sbcl with message "out of memory". > Each thread gets it's own stack and tls area allocated, > which is probably part of what you are seeing here. I've tried also with thread pool in the web server, in particular configuring the thread pool to have only one thread (note, -c parameter of ApacheBench is the count of threads that is used by ApacheBench, not by web server). Also I've tried to specify some not big value to the --dynamic-space-size sbcl runtime option. With this sbcl signals "dynamic space exhausted" at some point. > > Is it possible to deal with it somehow? > Run less threads, and/or get more memory? 64Mb is tiny -- > esp. when you consider that plain SBCL image is almost 24Mb! Yes, but the work of the web server is not so heavy: read few strings from the socket connection and write some strings + binary array back to the connection. I suppose the problem is that memory is reserved faster than garbage collector have time to release it (even if the memory is already garbage). I've also tried to run (sb-ext:gc :type :full) after every several requests handled by the web server (for example after every 4). In this case sbcl is alive and more stable, but nevertheless it has difficulties: it became slow and web server sometimes drops requests. Also I've observed: debugger invoked on a SB-KERNEL::MEMORY-FAULT-ERROR in thread #<THREAD {B7528C1}>: memory fault Maybe there is a way to speedup garbage collector or to tune sbcl to use less memory? (not generate debug information, etc.) Thanks, -Anton |