开发者

Perl daemon script for message queue hanging for 20 seconds after each process. Why?

开发者 https://www.devze.com 2022-12-29 16:57 出处:网络
I have daemon script written in Perl that checks a database tables for rows, pulls them in one by one, sends the contents via HTTP post to another service, then logs the result and repeats (only a sin

I have daemon script written in Perl that checks a database tables for rows, pulls them in one by one, sends the contents via HTTP post to another service, then logs the result and repeats (only a single child). When there are rows present, the f开发者_如何学Goirst one is posted and logged immediately, but every subsequent one is delayed for around 20 seconds. There are no sleep()'s running, and I can't find any other obvious delays. Any ideas?


Without code nobody can help you. You should reduce your code in a minimum testcase that represent your error and post it here. Probablby if you this often you find the error yourself.

And probably even without "sleep" your process can hang if you don't did asynchronous programming and call something that just takes a long of time to execute.

You can find such code that hangs if you execute your program in a profiler like Devel::NYTProf

0

精彩评论

暂无评论...
验证码 换一张
取 消