facebookarchive / libphenom

An eventing framework for building high performance and high scalability systems in C.
http://facebook.github.io/libphenom
Apache License 2.0
1.66k stars 362 forks source link

we must set limit for wbuf and rbuf in struct ph_sock. #66

Closed ghost closed 9 years ago

ghost commented 10 years ago

struct ph_bufq { PH_STAILQ_HEAD(bufqhead, ph_bufq_ent) fifo; // Maximum amount of storage to allow uint64_t max_size; };

we may use max_size to set limit for rbuf and wbuf in ph_sock to prevent too many memory cost. But i can't find detail describe for this.

we may disable socket read in nbio when rbuf reached its limit, and disable wbuf write when wbuf reach its limit.

why not implement this feature ?

wez commented 10 years ago

Sorry for the overly long delay in responding.

We haven't gotten around to writing the code that checks and enforces this limit yet. If you've got some spare cycles and want to submit a pull request, I'd be happy to review and work through getting it into libphenom.

Thanks!

wez commented 9 years ago

We just pushed 4d56a10b2c7f36a169400a85dbb76397bc1f11d5 to tackle a slightly different but related issue. I'm not sure if this covers exactly the case that you're experiencing, but it may be helpful.

ghost commented 9 years ago

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

wez commented 9 years ago

We're definitely open to hooking this up, but don't have immediate plans to do so. Patches are welcomed! I'm going to close this issue in the meantime