[Support] Linuxserver.io - Unifi-Controller


Recommended Posts

Sorry I missed your messages Chas. 

 

Is there any update from anyone who set a 4gb docker limit if the docker is ok and didnt go mad with ram usage yet? Like hoopster or penguin maybe?

 

I was thinking that 4gb limits would allow the dockers to average 2.8gb in size for RAM. 
 

I looked up the hardware appliances that unifi sell (eg udmp) and they ship with 4gb ram so believe this is the amount they will optimise for. 

 

P

Edited by PeteAsking
Link to comment
14 minutes ago, PeteAsking said:

 

Is there any update from anyone who set a 4gb docker limit if the docker is ok and didnt go mad with ram usage yet?

Been mostly "off the grid" for three days enjoying some national park hikes and wilderness recreation.

 

I restarted the container with a 4GB limit just before I left.  I returned to find RAM usage at 1.144GB after a little more than three days.  Before setting the limit, I had seen usage as high as 1.3GB after two days.

 

Even with the limit, RAM utilization climbs every day but the rate of increase seems to have slowed.

  • Like 1
Link to comment
24 minutes ago, PeteAsking said:

Most likely it will not grow beyond 70% of the limit you set

I doubt I'll ever see it that high.  Since CA Appdata backup restarts the container once a week for the backups, it resets the RAM utilization before I ever see it get to even 2GB, limit or no limit on the container RAM.

Link to comment

I haven't set a limit yet on mine but turning off DPI has worked well for me.

There was still a memory leak somewhere but it's not as bad, I got to 950MB after 5 days.

 

However, I noticed another update yesterday and it's at 705MB after 12 hours running (it started at 709mb) so curious to know what's changed as unifinis still reporting the same controller version (5.13.29)

 

Edit: another hour later and the ram has fallen further to 682MB!?!

Edited by geekypenguin
Link to comment
46 minutes ago, geekypenguin said:

Ok so another update, now been running for over 3 days with the most current docker container, no ram cap and DPI turned off, and my ram is sitting just below 800MB used.

It may be that DPI uses the database quite a bit and the DB is configured to cache as much as it can in RAM, so wthout a limit, and DPI on, it just eats up whatever it can, however with a limit is forces it to cleanup the cache as it fills close to the limit, meaning the problem you guys see is a combination of things working in conjunction to create the scenario you see.

Link to comment
1 minute ago, PeteAsking said:

It may be that DPI uses the database quite a bit and the DB is configured to cache as much as it can in RAM, so wthout a limit, and DPI on, it just eats up whatever it can, however with a limit is forces it to cleanup the cache as it fills close to the limit, meaning the problem you guys see is a combination of things working in conjunction to create the scenario you see.

I have DPI on and a 4GB limit set.  I thought the result was going to be a RAM usage reduction, but, after the latest restart, RAM usage is growing at the same rate it was before I specified the limit.

 

After a little more than two full days since the container was last updated, RAM utilization is at 1.4GB.

 

It is not a critical issue to me as I have plenty of RAM and it gets reset at least weekly with appdata backups and/or container updates. 

 

I have seen as much as a little less than 2GB RAM being used by this container and I am curious how much it would grow with no container limit and no regular restart; however, my curiosity is not going to lead me to try that experiment. 😁

  • Like 1
Link to comment
52 minutes ago, PeteAsking said:

Someone has to do the experiment for everyone to find out

OK Pete, just because you are Asking, I'll bite.

 

Container set to 2GB limit and restarted.  DPI still on.

 

If the container crashes and I have to restart it, no big deal.  This isn't Plex after all.  No angry mobs appear if the UniFi controller goes down!

  • Like 1
  • Haha 2
Link to comment
On 6/24/2020 at 5:33 PM, Hoopster said:

OK Pete, just because you are Asking, I'll bite.

 

Container set to 2GB limit and restarted.  DPI still on.

 

If the container crashes and I have to restart it, no big deal.  This isn't Plex after all.  No angry mobs appear if the UniFi controller goes down!

So what happened?

Link to comment
30 minutes ago, PeteAsking said:

So what happened?

I had a power outage this morning and the UPS shut down the server. 

 

Last time I noted RAM usage on the container was yesterday and it was up to almost 1.8 GB (approaching the 2GB limit). 

 

Unfortunately, today's forced restart means I have to start over monitoring the RAM utilization.  It is currently at 795MB after 7 hours uptime.

  • Like 1
Link to comment

Is anyone else having problems with this docker not autostarting? It will start fine if I start it manually.

 

Please see log below where the first set is the docker not starting at boot and the next set is me manually starting it. Any ideas?

 


-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid: 99
User gid: 100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy called
s6-svwait: fatal: timed out
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 10-adduser: executing...
usermod: no changes

-------------------------------------
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid: 99
User gid: 100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing...
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing...
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 99-custom-scripts: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-scripts: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.

Edited by cobhc
Link to comment

I've tried installing this container a LOT of times, bridge mode, host mode, on its own ip address, with the standard ports, with extra ports, with fewer ports, no matter what I do the controller never finds any devices.  When I install the pducharme controller my devices are found immediately.  I've been trying to get this container to see my devices on and off for maybe a year..the strangest thing to me is that no one else on this form (as far as I can tell) has this problem.  I don't think that my network has an especially unique setup.

 

I would love to hear any suggestions for things I could try to get this working.  I could easily go to the pducharme container but at this point it's just bugging me that I haven't gotten this version working.

Link to comment
5 hours ago, romain said:

I've tried installing this container a LOT of times, bridge mode, host mode, on its own ip address, with the standard ports, with extra ports, with fewer ports, no matter what I do the controller never finds any devices.  When I install the pducharme controller my devices are found immediately.  I've been trying to get this container to see my devices on and off for maybe a year..the strangest thing to me is that no one else on this form (as far as I can tell) has this problem.  I don't think that my network has an especially unique setup.

 

I would love to hear any suggestions for things I could try to get this working.  I could easily go to the pducharme container but at this point it's just bugging me that I haven't gotten this version working.

You dont provide much info but did you do the basics like set the controller IP and the setting underneath it that says override inform host with controller ip?

Link to comment
On 6/29/2020 at 9:51 PM, Hoopster said:

Yes, no problems.

To further assist in reducing the memory footprint I have been working on the following:

 

Assumptions for proposed changes:

1) You have less than 50 unifi devices being controlled by the controller. (Do not make these changes if your installation manages over 50 devices.)

2) Docker is limited to 2GB as per previous discussion.

3) The controller should sit around 1GB but may during busy periods use more.

 

proposed edits:

nano nano /mnt/disk1/appdata/unifi-controller/data/system.properties

 

Interesting values:

db.mongo.connections_per_host=64
db.mongo.threads_multiplier=3

Max number of threads allowed to write to the DB can be 64*3=192. (Default vaulue for controller is 100 and 5 = 500 threads).

 

inform.max_keep_alive_requests=32
inform.num_thread=64

This sets the largest number of devices the controller can respond to to be 64, and that missed heartbeats from devices can be up to 32. (Default values are are 200 normally.)

 

unifi.xms=256
unifi.xmx=768

Sets initial DB heap size to 256MB and Maximum heap size to 768MB (Default unifi expects is 2GB).

 

Expected outcome:

unifi controller will reduce memory usage, and compensate by increasing CPU usage on the docker controller as more time will be spent clearing out and writing to the database more often.

 

Example system.properties file (bottom section shown):

#Sat Jul 04 21:07:44 UTC 2020
db.mongo.connections_per_host=64
db.mongo.threads_multiplier=3
debug.device=warn
debug.mgmt=warn
debug.sdn=warn
debug.system=warn
inform.max_keep_alive_requests=32
inform.num_thread=64
is_configured_and_restarted=true
is_default=false
reporter-uuid=fb1782e2-e754-4e7b-a8c6-2015572f423c
unifi.xms=256
unifi.xmx=768
uuid=088aa964-4245-4d3d-8a70-3f519c3e45b6

 

 

Please let me know how this goes for you with these changes.

To revert, remove the 6 lines added into the settings file as above.

 

Obviously once changes are made, the docker must be stopped and started again.

 

Pete

Edited by PeteAsking
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.