PS:原创文章,如需转载,请注明出处,谢谢!
本文地址:http://flyer0126.iteye.com/blog/1886635
最近一直困扰的问题得到了解决。
项目中利用gearman实现异步处理,worker端涉及对mysql数据库及redis缓存的一系列操作,但是在实际的使用中发现很短时间后就会退出,开始查看log也没什么异常,通过程序端设置set_time_limit(0), try/catch 捕获异常、服务器端查看日志,通过strace 跟踪进程执行时的系统调用等等也没有什么改善,问题依旧,一时感觉很是无解啊。
折腾至最后简化worker端功能,只简单实现redis的List 链表新增一项功能,结果没多长时间服务又停止了。这次查看日志有了新收获,通过查看php-fpm.log.error,发现如下一行提示:
[14-Jun-2013 10:32:30] PHP Fatal error: Uncaught exception 'RedisException' with message 'read error on connection' in XXXX:35
经过查找各方资料,发现是php.ini文件中的一个配置项导致:
default_socket_timeout = 60
由于redis扩展也是基于php 的socket方式实现,因此该参数值同样会起作用。
找到了问题就比较好解决了:
1、直接修改php.ini,将其设置为我们想要的值(这个不推荐)
2、在我们的脚本中通过以下方式设置,这样就比较灵活,不对其他脚本产生影响
ini_set('default_socket_timeout', -1); //不超时
相关推荐
The specific example is parsing a MySQL error log file, organizing the data into unique dates and error messages, and counting the number of times each error message appeared on each date. The ...
OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 54 这个错误是因为网络太慢,下载virtualbox.box失败,可以换个网络再试一下。 如果网络实在太慢的话,可以试试下面的方法,我们可以手动下载virtualb
For example, a shared intent lock placed at the table level means that a transaction intends on placing shared (S) locks on pages or rows within that table. Setting an intent lock at the table level ...
disappeared with no error message. Release 5.3 build 1030 WIN32 release 25 September 2008 - Changes to investigate a BurnInTest crash problem on XP SP3. Release 5.3 build 1028 WIN32 release 11 ...
S7A驱动,7.20版本, Version history S7A OPC server and FIX driver for Siemens S7/S5 communication ... - Error in MIX Read function could cause blocking of data blocks...
4. 最后,这个异常在 `requests.models` 模块的 `generate` 函数中被捕获,引发了 `requests.packages.urllib3.exceptions.ProtocolError`,并附带了关于连接被破坏的详细信息。 解决这个问题的方法通常包括以下几...
- **4.1.20** `UPNP_E_SOCKET_CONNECT [-204]`: Indicates a connection error on a socket. - **4.1.21** `UPNP_E_OUTOF_SOCKET [-205]`: Signals that there are no more available sockets. - **4.1.22** `UPNP_E...
22. Five generic tasks are error control, flow control, segmentation and reassembly, multiplexing, and connection setup. Yes, these tasks can be duplicated at different layers. For example, error ...
- **接收消息**:`dbus_connection_read_write_dispatch()`读取、写入和调度消息。 - **处理回复**:对于同步方法调用,使用`dbus_message_get_reply_serial()`检查回复,并通过`dbus_connection_send_with_reply_...
error_reporting ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED ; Development Value: E_ALL ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT ; html_errors ; Default Value: On ; ...
- Connection Delete Confirmation Window - message not read - Connections > right-click Export - not read - Connections > Tables > right-click - not reading clear filter - Connections > Database ...
Create online documents from Word documents quickly with Word-2-Web. DocAuto products also contain other software that can be helpful to you: CommentAuto: Generate large amount of comments for you ...
Console.WriteLine("Error: " + ex.Message); return null; } } } ``` 在这个例子中,`connectionString`包含了连接Oracle数据库所需的所有信息,包括服务器地址、端口、服务名、用户名和密码。根据实际的Oracle...
reason, the "Check Connection Error" window open. Confirm that the transceiver is correctly connected to the computer via a KPG-22/46 cable, then select "[Retry]". Write To Radio Help This ...
log.Println("Error reading from connection:", err) break } fmt.Printf("Received from client: %s\n", buffer[:len]) // 发送响应数据 _, err = conn.Write(buffer[:len]) if err != nil { log.Println...
- FIX Remaks panel focusing on main form (via PostMessage), since TreeInspector in FlexEditSE captures focus on self. - FIX Invalid arc size calculation when flex-control's size changes via DocRect ...
fill data with your message ... clientSocket.write(data); if (clientSocket.waitForBytesWritten()) { // successful write } QByteArray receivedData = clientSocket.readAll(); // process received...
Console.WriteLine("Error: " + ex.Message); } } } ``` 这个方法会打开连接,执行SQL语句(这里是非查询操作,如插入、更新或删除),然后关闭连接。如果在执行过程中发生异常,它将捕获并打印错误消息。 对于...
Implement error handling mechanisms like Exception Classes and Message Types to manage errors during file retrieval or IDoc processing. D.2) Security Ensure proper security measures are in place for ...
just go tohttp://groups.yahoo.com/group/sakemail/History:0.9 - First released version0.9.1b -Fixed when a mail server reply on the connection with more than one line0.9.2b - I forget to return a value...