wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

Don't release Shared memory #192

Closed N1Knight closed 8 years ago

N1Knight commented 9 years ago

Hi. Nginx don't release shared memory but dont know why. Any knows? Thanks.

Channels stats:

<infos>
<hostname>---</hostname>
<time>2015-07-20T16:09:46</time>
<channels>19</channels>
<wildcard_channels>0</wildcard_channels>
<published_messages>12486488</published_messages>
<stored_messages>81</stored_messages>
<messages_in_trash>21</messages_in_trash>
<channels_in_trash>2</channels_in_trash>
<subscribers>13</subscribers>
<uptime>600001</uptime>
<by_worker>
<worker>
<pid>24141</pid>
<subscribers>13</subscribers>
<uptime>600001</uptime>
</worker>
</by_worker>
</infos>
wandenberg commented 9 years ago

What do you mean by "don't release shared memory" ? There isn't anything wrong with your statistics. If it wasn't releasing the objects would be much more messages in stored_messages or messages_in_trash.

What is the problem that you are facing?

N1Knight commented 9 years ago

worker with this statistics and used "top -p 24141" returned this

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
24141 apache    20   0 99.6m  46m  39m S  0.0  0.1  41:48.99 nginx

In nginx.conf, we have set this:

push_stream_shared_memory_size              48M;

this web service only work for pushModule

wandenberg commented 9 years ago

Nginx shared memory works in a pool system. As far as I know, once allocated and freed it will not return the memory to the system. But will use again on next allocation. You can see that the SHR is below the vale that you have set.

If you publish a lot of messages it will reach the limit and write something like "no shared memory" on logs. After sometime you will be able to publish again, but the number under SHR will not decrease.