Skip to content
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

Option to cloud-init template and TF to modify ulimit for file process #47

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rickardl
Copy link

@rickardl rickardl commented Aug 7, 2020

Adds option to TF module to change soft and hard limit, fixes #10

Copy link

@neilh456 neilh456 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can we not put this in the AMI. We could increase the limits in
/etc/security/limits.conf

  •     hard    nofile      100000
    
  •     soft    nofile      100000
    

hard nofile 100000
soft nofile 100000

Or system wide in /etc/sysctl.conf
fs.file-max = 100000

Just a question, I can approve afterwards

Copy link
Contributor

@itsdalmo itsdalmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at e.g. the below issue, it seems like the limit needs to be set outside the systemd.unit:
syncthing/syncthing#5319 (comment)

Are you sure this works/have you tested it?

edit:

Here is an example configuration from a concourse issue:
concourse/concourse#480 (comment)

[Unit]
Description=Concourse Worker
After=network.target

[Service]
EnvironmentFile=/opt/concourse/etc/worker.conf
ExecStart=/opt/concourse/bin/concourse worker
KillMode=process
LimitNPROC=infinity
LimitNOFILE=infinity
TasksMax=infinity
Restart=on-failure
RestartSec=3
ExecStop=/bin/kill -USR2 $MAINPID ; /usr/bin/tail --pid $MAINPID -f /dev/null
TimeoutStopSec=300

[Install]
WantedBy=multi-user.target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make sure we are not hitting systemd task limits
3 participants