Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please remove "Setting max connections" in postgresql container. #3040

Closed
Llewellynvdm opened this issue Jul 27, 2023 · 4 comments
Closed

Please remove "Setting max connections" in postgresql container. #3040

Llewellynvdm opened this issue Jul 27, 2023 · 4 comments

Comments

@Llewellynvdm
Copy link

MAX_CONNECTIONS=$((MEMORY/50+3))

Can you please either remove this, or add a ENV value with which to override this, thanks.

You ask why?

This limitation seems to block that deployment of all-in-one from being used in production, or for more than three users, or for more that 1TB of files... what ever that means, the amount of connections hit this limit and the stalls the server.

When I remove this limitation, this stalling and freezing-up of the system does not happen, but the moment and update runs, and my "hack" gets removed... we are back at freezing mode.

So if this is a critical feature then please add a global ENV option for us to set this to a value of our choosing.

I have read many forum posts around this topic and I am not sure why this should even be a question in a OpenSource project with GNU AFFERO GENERAL PUBLIC LICENSE. As this very agreement allows the end-user all the freedom they need, and since this limit prevent some of that freedom, I would strongly recommend it be made adjustable. Please :)

@Llewellynvdm Llewellynvdm changed the title Please reove "Setting max connections" in postgresql container. Please remove "Setting max connections" in postgresql container. Jul 27, 2023
@szaimen
Copy link
Collaborator

szaimen commented Jul 27, 2023

We have something better in mind: #3021

@szaimen
Copy link
Collaborator

szaimen commented Jul 27, 2023

You could already try this: #3030 (comment) and report back if it works

@Llewellynvdm
Copy link
Author

This is my little hack:

How to fix the MAX_CONNECTIONS limit

This causes the system to freeze/hang when many activity is done on the system. The default seems way to low, (350+-) I bump it to (2500) but I think we can even take it higher.

You will need access the server!

Open the master container:

docker exec -it --user root  nextcloud-aio-mastercontainer /bin/bash

Then edit this file:

vi php/containers.json

Look for the object of the database:

"container_name": "nextcloud-aio-database"

To edit:

press: [i]

Then add the following mount point (check the last volume /start.sh):

     "volumes": [                                  
        {                                           
          "source": "nextcloud_aio_database",       
          "destination": "/var/lib/postgresql/data",
          "writeable": true                         
        },                                          
        {                                           
          "source": "nextcloud_aio_database_dump",  
          "destination": "/mnt/data",               
          "writeable": true                         
        },                                          
        {                                           
          "source": "/home/ubuntu/db/start.sh",  
          "destination": "/start.sh",               
          "writeable": true                         
        }
     ]

When done editing the file:

press: [Esc]

Then to save changes:

press: [:w] and [enter]

To close vi editor:

press: [:q]

Check the file on the parent system:

/home/ubuntu/db/start.sh

That it is up to date with:

https://github.com/nextcloud/all-in-one/blob/main/Containers/postgresql/start.sh

But update the following line that says: (Setting max connections...):

Change it to the following:

echo "Setting max connections for MORE"
# MEMORY=$(awk '/MemTotal/ {printf "%d", $2/1024}' /proc/meminfo
MAX_CONNECTIONS=2500

You can make it more... if 2500 is still not high enough.

Once all that is done, restart the whole system, go to:

https://nextcloud.domain.com/settings/admin/overview

Click on Open Nextcloud AIO Interface ↗ and stop all containers and start them all again.

If you can't access https://nextcloud.domain.com/ then go directly to:

https://xxx.xxx.x.x:8080/containers

@Llewellynvdm
Copy link
Author

I have been following the changes made to the system in the last two months closely and I am not sure why things are increasingly getting harder for us to override the defaults of the various containers. I realize there must be some good objective but one of the changes made... like this one: 581456b does not make sense to me. Why add this command: chmod -R 777 /var/run/postgresql; which any way is not allowed, and serious bad practice: chmod: /var/run/postgresql: Operation not permitted
image

Yet this stops us from adding a simpler solution to the above issue. So hope you understand why it all seems weird to me. Previously it was easy to just change the start.sh directly but now its no longer possible, now we need this whole workaround, because of the read_only added to the php/containers.json

But like I said there must be so good objective here, its just messing with us little guys I suppose... do you mind explaining the objective, or point me to the road map?

@nextcloud nextcloud locked and limited conversation to collaborators Jul 29, 2023
@szaimen szaimen converted this issue into discussion #3055 Jul 29, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants