-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SySV Errors after a while. #17
Comments
I stayed away from workers due to limitations with the IPC layer. A few things the author has noted:
Looking at your logs, I think you're encountering those limitations:
I'm not sure if it'll help your situation, but have you considered using tasks instead of workers? Tasks are the same thing, only they don't communicate back to the main daemon process thereby avoiding the IPC bottleneck entirely. They are fire and forget. In my use case, I've got 5 daemons running, each one monitors various azure queues and fires off various processes (tasks) when there are messages in a queue. Each task runs as its own process in linux -- they exit gracefully and I have been hammering these daemons pretty hard. I can process hundreds of messages per second using this approach and its been super stable. Just gotta make sure you keep the execute() logic light and have your tasks do all the heavy lifting. I process multiple message per task before letting that task exit -- just so im not spawning a process for every single message a queue. Example: /**
* Main application logic.
* Called every loop cycle
**/
protected function execute()
{
# broadcast a heartbeat every 5 minutes (based on run interval)
if ($this->getLoopIterations() % 60 == 0) {
$this->log("service status: okay");
}
try {
# get order queue counts
$createCount = AzureQ::queueCount('shopify-create');
$ordersCount = AzureQ::queueCount('shopify-orders');
} catch (Exception $e) {
return;
}
# kick off appropriate processor
if ($createCount > 0) { $this->task('OrderCreate'); }
if ($ordersCount > 0) { $this->task('OrderProcess'); }
} use Lifo\Daemon\Task\AbstractTask;
class OrderProcess extends AbstractTask
{
# easy access to the daemon logging routines
# so we don't have to use Daemon::getInstance()->log
use \Lifo\Daemon\LogTrait;
public function run()
{
#do stuff
} |
nothing i can do with this right now. |
Hello,
I'm trying to setup a daemon using your package, the daemon pulls n jobs from a queue (beanstalk/sqs/whatever) and for each job it calls to the needed worker, actually the worker does nothing but create a response, fake an execution time and returns the response to the daemon. It all goes fine until I start getting SySV related errors like these after a while:
my main class looks as follows:
about workers, it is set to autorestart and max_processes = 10, my worker code:
and daemon init code:
hope you can help me.
Thanks in advance.
Diego.
The text was updated successfully, but these errors were encountered: