[OpenSIPS-Devel] Memory Lick problem

Liviu Chircu liviu at opensips.org
Tue Mar 4 22:01:05 CET 2014


That assumption is based on common memory allocation patterns. Biggest 
ones typically come from tm, around 20k / transaction.

I also assumed you set the /fr_timer/ to a lower value (say 10 seconds). 
So, in order to consume ~150MB of memory (tm's ratio out of 220MB), 
OpenSIPS needs to be holding only 7500 transactions, thus 750 
transactions / sec given my timer assumptions, or 250 transactions / sec 
by default.

I went with these assumptions as soon as I saw that /used_size/ 
eventually returned to normal: 3MB, so it's doesn't look like we're 
dealing with a leak.

So either bad performance tunings or some DOS attempts.

On 04.03.2014 19:19, Mike Tesliuk wrote:
> Hello Liviu ,
>
> This opensips is on a small carrier, we expected in some weeks reach 
> almost 2000 simultaneos calls, 750 is something that can happen right 
> now, we have all kind of customers like call centers, small companies 
> , residencial customers and other carriers, so we realy want to reach 
> a high number of calls with opensips, but 750 cps is diferent than 
> simultaneos calls (i think), i will check if we are getting some kind 
> of DOS attack
>
> i will change the memory parameters as you suggest.
>
> Just one question for you, how you interpret the value below as 750 cps ?
>
> shmem:used_size = 3401120
> shmem:max_used_size = 226816344
>
>
>
>
> 2014-03-04 11:16 GMT-05:00 Liviu Chircu <liviu at opensips.org 
> <mailto:liviu at opensips.org>>:
>
>     Hello Mike,
>
>     MySQL data looks like peanuts. We can safely ignore it. The
>     following stats are quite interesting:
>
>     shmem:used_size = 3401120
>     shmem:max_used_size = 226816344
>
>     From the *tm* module's point of view, this means that your server
>     was hit, at some point in time, by a traffic of over 750
>     transactions/sec! If we add the memory consumption of other
>     modules (dialog, usrloc), and a more aggressive peak hour, it may
>     be quite normal for memory consumption to reach 1GB!
>
>     Can you share some details about the nature of your traffic? Do
>     you expect traffic of over 750 cps regularly? If yes, then:
>
>     * -m 7192 is a good idea. You can probably reduce it a bit, like 4096.
>     * _-M 512 is too much_. 64MB should be more than enough for an
>     OpenSIPS listener on *any* scenario.
>
>     If you don't expect such traffic, then it looks like a denial of
>     service attack, case in which you should look into the *ratelimit*
>     module.
>
>
>     Best regards,
>
>     Liviu Chircu
>     OpenSIPS Developer
>     http://www.opensips-solutions.com
>
>     On 03/04/2014 03:43 PM, Mike Tesliuk wrote:
>>     Hello Liviu,
>>
>>     The address table have 110 records, and the subscriber have 1738
>>     records, i have 342 users registered
>>
>>     and im using the loadbalancer with 10 records
>>
>>     About recompile yes, i can recompile, i already have done this
>>     before  , you said that the logs that i send was ok, nothing like
>>     a memory leak, but i can do, as i told you i change the memory
>>     parameteres as you can see below
>>
>>     /usr/local/opensips/sbin/opensips -P /var/run/opensips.pid -f
>>     /etc/opensips/opensips.cfg -m 7168 -M 512
>>
>>
>>     im running now since March 1st  .
>>
>>     Right now my fifo get_statistics show me
>>
>>     shmem:total_size = 7516192768
>>     shmem:used_size = 3401120
>>     shmem:real_used_size = 46974408
>>     shmem:max_used_size = 226816344
>>     shmem:free_size = 7469218360
>>     shmem:fragments = 449173
>>
>>     pkmem:0-total_size = 536870912
>>     pkmem:0-used_size = 105424
>>     pkmem:0-real_used_size = 412856
>>     pkmem:0-max_used_size = 555464
>>     pkmem:0-free_size = 536458056
>>     pkmem:0-fragments = 3
>>     pkmem:1-total_size = 0
>>     pkmem:1-used_size = 0
>>     pkmem:1-real_used_size = 0
>>     pkmem:1-max_used_size = 0
>>     pkmem:1-free_size = 536442160
>>     pkmem:1-fragments = 0
>>     pkmem:2-total_size = 536870912
>>     pkmem:2-used_size = 133888
>>     pkmem:2-real_used_size = 480680
>>     pkmem:2-max_used_size = 555464
>>     pkmem:2-free_size = 536390232
>>     pkmem:2-fragments = 307
>>     pkmem:3-total_size = 536870912
>>     pkmem:3-used_size = 122928
>>     pkmem:3-real_used_size = 441400
>>     pkmem:3-max_used_size = 555464
>>     pkmem:3-free_size = 536429512
>>     pkmem:3-fragments = 109
>>     pkmem:4-total_size = 536870912
>>     pkmem:4-used_size = 122928
>>     pkmem:4-real_used_size = 441496
>>     pkmem:4-max_used_size = 555464
>>     pkmem:4-free_size = 536429416
>>     pkmem:4-fragments = 110
>>     pkmem:5-total_size = 536870912
>>     pkmem:5-used_size = 123080
>>     pkmem:5-real_used_size = 457584
>>     pkmem:5-max_used_size = 555464
>>     pkmem:5-free_size = 536413328
>>     pkmem:5-fragments = 276
>>     pkmem:6-total_size = 536870912
>>     pkmem:6-used_size = 123088
>>     pkmem:6-real_used_size = 460184
>>     pkmem:6-max_used_size = 555464
>>     pkmem:6-free_size = 536410728
>>     pkmem:6-fragments = 303
>>     pkmem:7-total_size = 536870912
>>     pkmem:7-used_size = 103360
>>     pkmem:7-real_used_size = 408680
>>     pkmem:7-max_used_size = 555464
>>     pkmem:7-free_size = 536462232
>>     pkmem:7-fragments = 4
>>     pkmem:8-total_size = 536870912
>>     pkmem:8-used_size = 119736
>>     pkmem:8-real_used_size = 431584
>>     pkmem:8-max_used_size = 555464
>>     pkmem:8-free_size = 536439328
>>     pkmem:8-fragments = 38
>>
>>
>>     But im not on my peak of use now, is holiday in Brazil so we dont
>>     have too much users running
>>
>>
>>     _______________________________________________
>>     Devel mailing list
>>     Devel at lists.opensips.org  <mailto:Devel at lists.opensips.org>
>>     http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>
>
>     _______________________________________________
>     Devel mailing list
>     Devel at lists.opensips.org <mailto:Devel at lists.opensips.org>
>     http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>
>
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel

-- 
Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20140304/689f9f18/attachment-0001.htm>


More information about the Devel mailing list