pivotal-cf/ulimit-release

Name: ulimit-release

Owner: Pivotal Cloud Foundry

Description: BOSH Release to increase max open files for co-located jobs

Created: 2017-02-10 18:56:54.0

Updated: 2017-06-28 16:37:58.0

Pushed: 2018-01-16 19:48:36.0

Homepage:

Size: 10

Language: C

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ulimit release

A BOSH release which mimics the function of ulimit

0. Usage

Upload release to director.

Set properties in manifest:

erties:
file:
soft: 16384
hard: 16384
Inner workings & Bugs

Only works for the ulimit property “open files”.

Creates /etc/security/limits.d/62-ulimit.conf.

Dynamically adjust monit's “Max open files”.

This runs as a pre-start script.

Fixes: Accept error: accept tcp [::]:80: accept4: too many open files.

Defaults to 16384/16384 soft/hard limit for all users.

This was tested on Ubuntu and CentOS stemcells.

This release has 2 components:

  1. A pre-start executable (pivotal_prlimit, a small C program which uses prlimit(2)) which modifies the ulimit of the running monit process. monit, as it forks sub-processes (i.e. as it starts jobs), will pass along the updated ulimits (max number of open files). This makes sure the ulimit is set on initial deployment.

  2. A template which creates /etc/security/limits.d/62-ulimit.conf which sets the ulimit on reboot (pre-start scripts are not run on reboot).


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.