gearman

Problem with Gearman: GEARMAN_COULD_NOT_CONNECT

拜拜、爱过 提交于 2020-01-03 05:00:25
问题 I've installed gearman using "apt-get install gearman-server" and than build the PHP PECL. If i try the worker: $ gearman -w -f wc -- wc -l It starts waiting. right. But if i try to start a job (as descriped in the tutorial) $ gearman -f wc < /etc/passwd it says: gearman: gearman_client_run_tasks : flush(GEARMAN_COULD_NOT_CONNECT) 127.0.0.1:4730 -> libgearman/connection.cc:480 And if i try the PHP str_rev demo descriped in the tutorial it gives me the very same error. PHP Warning:

Gearman PHP Extension: Dead Job Server = Slow Response from all Workers

↘锁芯ラ 提交于 2020-01-02 15:52:06
问题 I started with this question: Gearman: 3 seconds between client request and worker receive. Is this normal? Environment: Ubuntu 12.04 Desktop PHP 5.3.10 Gearman (libgearman 1.1.5 with PHP Extension 1.1.1) Multiple servers on LAN I couldn't get a worker response time of less than 3 sec and I couldn't figure out why. I narrowed it down to a wrapper class I'd built. I then narrowed it further to a specific method within the class. Long story short the real problem seems to lie in the addServer

asynchronous processing with PHP - one worker per job

孤街醉人 提交于 2019-12-29 03:34:52
问题 Consider a PHP web application whose purpose is to accept user requests to start generic asynchronous jobs, and then create a worker process/thread to run the job. The jobs are not particularly CPU or memory intensive, but are expected to block on I/O calls fairly often. No more than one or two jobs should be started per second, but due to the long run times there may be many jobs running at once. Therefore, it's of utmost importance that the jobs run in parallel. Also, each job must be

Where does mysql save the path for gearman mysql udf files?

吃可爱长大的小学妹 提交于 2019-12-24 04:16:28
问题 I have been trying to use gearman mysql udf. I have downloaded tarball from http://gearman.org/index.php?id=download and installed it with the instructions given on http://gearman.org/index.php?id=mysql_udf_readme I am trying to create the gman_do function in mysql, but I am getting some error The Error is- mysql> create function gman_do returns string soname "libgearman_mysql_udf.so"; ERROR 1126 (HY000): Can't open shared library 'libgearman_mysql_udf.so' (errno: 22 /usr/local/lib/libgearman

Asynchronous database/service calls in PHP: Gearman vs. pthreads

扶醉桌前 提交于 2019-12-23 12:44:57
问题 On our LAMP site, we have a problem with some services having to make several calls to the database to pull data. Usually the way this is done in PHP (at least my experience) is serially; which obviously is inefficient. We can mitigate some of the inefficiencies by using caching and aggregating some queries; but in some cases we need to still need to do multiple db calls. Ideally, I would just send as many as requests as possible to the db or web services at the same time asynchronously, but

pcntl_signal callbacks are not executed

余生颓废 提交于 2019-12-22 17:54:54
问题 I am using php 5.4. I am using gearman and supervisor to control gearman workers. I want to catch the TERM signal produced by supervisor in PHP. I have the following worker code: pcntl_signal(SIGTERM, function($sig){ error_log("interrupted", false); }); while(true){ pcntl_signal_dispatch(); $gw->work(); } } My supervisor conf file is as follows: [program:public_pdf_convert] process_name = pdf_convert_%(process_num)02d command = /usr/local/bin/php worker_pdf_convert.php numprocs = 1 directory

How to effectively implement an algorithm [closed]

流过昼夜 提交于 2019-12-21 21:53:47
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . We've recently worked with a mathematician to build us an algorithm. The algorithm will look at click data and will continuously

What's best practice for HA gearman job servers

和自甴很熟 提交于 2019-12-20 19:38:14
问题 From gearman's main page, they mention running with multiple job servers so if a job server dies, the clients can pick up a new job server. Given the statement and diagram below, it seems that the job servers do not communicate with each other. Our question is what happens to those jobs that are queued in the job server that died? What is the best practice to have high-availability for these servers to make sure jobs aren't interrupted in a failure? You are able to run multiple job servers

Problem With Gearman Job Status

蹲街弑〆低调 提交于 2019-12-20 10:55:33
问题 I have a Gearman server running a process which takes a few minutes to finish. I'm running a progress bar to show completion, and am attempting to get the percentages for the bar using the Gearman PHP extension and the jobStatus() function. The job is definitely active and found, as the first two fields (known + still running) return to true. However the third and fourth fields (numerator and denominator of completion percentage) return with nothing. Does anyone know why this might be or how

Gearman with multiple servers and php workers

拈花ヽ惹草 提交于 2019-12-20 09:41:04
问题 I'm having a problem with gearman workers running on multiple servers which i can't seem to solve. The problem occurs when a worker server is taken offline, rather than the worker process being cancelled, and causes all other worker processes to error and fail. Example with just 1 client and 2 workers - Client: $client = new GearmanClient (); $client->addServer ('192.168.1.200'); $client->addServer ('192.168.1.201'); $job = $client->do ('generate_tile', serialize ($arrData)); Worker: $worker