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

fileDescriptorLimit could not set according to system default value #1158

Closed
SyinChwunLeo opened this issue Sep 14, 2018 · 7 comments
Closed

Comments

@SyinChwunLeo
Copy link

SyinChwunLeo commented Sep 14, 2018

Expected behaviour

when packaging, sbt-native-packager will use default value of fileDescriptorLimit or use user defined. If is it possible to use the ulimit value of app running machine?

for example, I package using the default value (1024), but the app running machine is 100000, when I check /proc/PID/limits, the "Max open files" is 1024, not 100000.

If I set a fixed value, the app will run on different machines, and their system "max open files" are different. Maybe it is unreasonable to use a fixed value when packaging

@SyinChwunLeo SyinChwunLeo changed the title fileDescriptorLimit could not set according to system default set fileDescriptorLimit could not set according to system default value Sep 14, 2018
@muuki88
Copy link
Contributor

muuki88 commented Sep 14, 2018

Thanks for your issue 😀
Can you add some information?

  • which OS you are running the application
  • which native-packager version are you using
  • how is the app starred ( systemd, systemV, upstart, .. )

I'm not aware that native-packager scripts mess with any file limit settings.

@SyinChwunLeo
Copy link
Author

  • I run the application on CentOS 7 and set configurations in /etc/security/limits.conf as follows:
*  soft   nofile    1000000
*  hard  nofile     1000000
and using ulimit -Hn  or ulimit -Sn command return 1000000.    
  • My sbt-native-packager is version 1.2.0
 addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.2.0") 
  • I use systemd
enablePlugins(RpmPlugin, JavaServerAppPackaging, SystemdPlugin)

@muuki88
Copy link
Contributor

muuki88 commented Sep 22, 2018

Thanks for the more detailed explanation 😄

At the moment we don't have conditional template replacements. This is the systemd template that renders the systemd service conf. Is there a "magic" value that says "use system default"?

I haven't had any issue with file descriptor limits. What's the use case for making this limit not application specific?

@SyinChwunLeo
Copy link
Author

I catch this case by a bug, In our application, HttpClient jar is used to call RESTFUL API, unfortunately, after running period of time, app throws "too many files open" exception.

@muuki88
Copy link
Contributor

muuki88 commented Sep 25, 2018

Thanks for sharing 🤗

I guess then there's no need to configure this in another way, right?

@SyinChwunLeo
Copy link
Author

maybe

@tolikr
Copy link
Contributor

tolikr commented Nov 16, 2018

Systemd ignores limits from places like limits.conf.
https://serverfault.com/questions/628610/increasing-nproc-for-processes-launched-by-systemd-on-centos-7

@muuki88 muuki88 closed this as completed Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants