Apache forking and preloading

28 views
Skip to first unread message

Oliver Bock

unread,
Oct 8, 2015, 6:52:14 AM10/8/15
to rapache
If I use RSourceOnStartup, will the R source be run once in each Apache worker process, or will it run once while Apache starts, and then be copied to each process via fork()?  I ask because I think I can speed up my R code by preloading all the R libraries I might need in my startup script.  This would be OK because fork()'s copy-on-write semantics mean that most of what I load into memory will be shared between processes.

On the other hand, if my startup code is run once for each process then I will be using lots of RAM by loading every library many times.


  Oliver
Reply all
Reply to author
Forward
0 new messages