rexyai / RestRserve

R web API framework for building high-performance microservices and app backends
https://restrserve.org
275 stars 32 forks source link

continuously post eat all memory and server crash #159

Closed longhua8800w closed 4 years ago

longhua8800w commented 4 years ago

as descripted above:" all the forked processes keep alive, eat all memory and server crash". this must not be expected, i may run into some low-level stupid mistake. can you provid any clue to solve this?

R version is 3.6 i use RestRserve construct a server to compute a model . if post the url once , it always work well. when i iterate post continuously 。 it always crash when the 40th time 。 error reported is "WARNING: fork() failed in Rserve_prepare_child(): Cannot allocate memory"

dselivanov commented 4 years ago

Rserve keeps connection open until client closes it. So if your clients don't close connections, worker processes will be alive (as per my understanding time alive is defined by TCP protocol config on your machine) and waiting communication from clients them. See related discussion and suggestions (like putting RestRserve behind proxy which will force connection close or force all clients to share pool of connections) in #25. I'm closing this ticket. We can continue in #25 if needed.

longhua8800w commented 4 years ago

Thank you for your timely reply ! According to your suggestion, we successfully solved the problem

dselivanov commented 4 years ago

Thank you for your timely reply ! According to your suggestion, we successfully solved the problem

@longhua8800w what did work for you?

long-do commented 4 years ago

Hello @longhua8800w , Could you share us your solution please? I have the same issue as yours. Thank you.