GitLab took too much memory

The gitlab execution on our company internal server eats lots of memory, the server has 32G memory, and gitlab took more than half of it.

 

I found there are lots of unicorn processes running, and each unicorn process is taking 1.5% memory
In top  command output it's displaying as ruby process and took nearly 500MB resident memory (by default top is sorting by cpu usage, pressing < or > key to change sorting column)
Running above command outputs 34, that means at most 34 unicorn processes are running (some other processes' name also contain unicorn)..
Assume there are 30 real unicorn process running, each takes 500MB memory, then they will take 30*500MB=15GB memory
To decrease unicorn processes count, edit /etc/gitlab/gitlab.rb, and uncomment following line

 

Next restart GitLab

Now the memory usage is decreased.

 

(Note that running gitlab-ctl reconfigure  will not kill already running unicorn processes)

HBase scan with multiple versions

HBase support multiple versions of data, when modifying a value, new version will be saved with timestamp.

Scan with versions

This will scan the table and number of versions is 4

Scan with versions and time range

We can also filter versions data further by time range.