dougaimian1143 2013-05-29 19:01
浏览 152
已采纳

当值太大时,php-handlersocket结果被截断

Our setup is as follows:

  • Primary DB Server, Amazon EC2 m2.xlarge instance (17GB ram, 2x3.25ecu CPU) running Percona 5.5.x
  • Application Server(s), Amazon EC2 m1.large instance (7.5GB ram, 2x2ecu CPU) running PHP 5.4
  • php-handlersocket PECL library found here http://code.google.com/p/php-handlersocket/

For the most part it works but as soon as I load up the app server with even relative traffic, the results start failing on queries where the result record(s) have fields with medium to large values. The two main culprits in our case are XML strings that are ~5Kb, and media files stored as binary objects 5-500Kb. The symptom is if I request 10 fields and the XML is in the 8th field, I'll get 7 results with data, and the 8th will be empty, 9 and 10 are not included at all.

There is a reported issue for the php-handlersocket library relating to this kind of problem, however there's also a proposed fix, which I've implemented and I thought it helped, but it seems not entirely. The issue details and fix are here http://code.google.com/p/php-handlersocket/issues/detail?id=28

My HandlerSocket settings are just slightly different than the defaults, should I be setting these different?

loose_handlersocket_port = 9998
loose_handlersocket_port_wr = 9999
loose_handlersocket_threads = 4
loose_handlersocket_threads_wr = 1
open_files_limit = 65535

I've reduced the default read threads to 4 since they recommend CORES * 2, the default is 16. I thought slower responses would be better than none at all, but this didn't seem to make a difference.

The php-handlersocket project looks to be dead which on it's own is a bit surprising, the last source updates were more than a year ago, but there doesn't seem to be any other PHP library available so I'm stuck.

I'm wondering if anyone has had similar problems, if there are other libraries available or if I should be exploring skipping libraries and creating my own interface with something like CURL.

  • 写回答

1条回答 默认 最新

  • dongzhao5970 2013-07-02 12:25
    关注

    So in the end, as with many problems, I became wary of an open source project with limited attention and decided to write my own php sockets based solution that's working perfectly.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?
  • ¥15 关于#vue.js#的问题:修改用户信息功能图片无法回显,数据库中只存了一张图片(相关搜索:字符串)
  • ¥15 texstudio的问题,