D
D
Daniel2542015-04-22 17:45:00
Ruby on Rails
Daniel254, 2015-04-22 17:45:00

How to drill down on Unicorn's memory usage?

Ruby 2.1.3 and Unicorn 4.8.3 are installed on two different machines running Ubuntu Server 14.04 x32
Inside this environment is the same Rails 4.2 application. But on one machine, Unicorn eats up twice as much memory.
Here are excerpts from the output of the cat /proc/PID/smaps
First Car command

00bea000-01615000 rw-p 00000000 00:00 0                                  [heap]
Size:              10412 kB
Rss:               10376 kB
Pss:               10012 kB
Shared_Clean:          0 kB
Shared_Dirty:        728 kB
Private_Clean:         0 kB
Private_Dirty:      9648 kB
Referenced:        10076 kB
Anonymous:         10376 kB
AnonHugePages:         0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd wr mr mw me ac sd
01615000-08823000 rw-p 00000000 00:00 0                                  [heap]
Size:             116792 kB
Rss:              111540 kB
Pss:              111540 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:    111540 kB
Referenced:       111540 kB
Anonymous:        111540 kB
AnonHugePages:         0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd wr mr mw me ac sd

Second car
09f35000-0a50d000 rw-p 00000000 00:00 0          [heap]
Size:               5984 kB
Rss:                5968 kB
Pss:                5878 kB
Shared_Clean:          0 kB
Shared_Dirty:        180 kB
Private_Clean:         0 kB
Private_Dirty:      5788 kB
Referenced:         5880 kB
Anonymous:          5968 kB
AnonHugePages:         0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd wr mr mw me ac sd 
0a50d000-0d8f7000 rw-p 00000000 00:00 0          [heap]
Size:              53160 kB
Rss:               53048 kB
Pss:               53048 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:     53048 kB
Referenced:        53048 kB
Anonymous:         53048 kB
AnonHugePages:         0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd wr mr mw me ac sd

These are the largest large chunks of memory used by this incomprehensible heap.
The problem machine was inherited. I set up the second one myself, for comparison.
I looked at the configs - I didn’t find anything interesting there, though maybe I didn’t look well.
Tell me where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shetani, 2015-04-25
@Shetani

In the environment configs (development, production), is the value of config.eager_load the same on both machines? If set to true, part of the application will be permanently in memory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question