|
I think it is the rand() function in Rails, the random generator has been initialized only once when the Rails Application starts, then RailsRunner for LSWS will fork() from the parent process, to process a request, then exit if idle for a while, then fork() another process when a new request comes in a while later. The random number generator has the same state for both children processes, so they produce the same random number.
The solution is to initialize the rondom number generator again before calling rand() function. In C it is srand() function, not sure what it is in Ruby.
|