Asked  7 Months ago    Answers:  5   Viewed   25 times

When running my application I sometimes get an error about too many files open.

Running ulimit -a reports that the limit is 1024. How do I increase the limit above 1024?

Edit ulimit -n 2048 results in a permission error.

 Answers

59

You could always try doing a ulimit -n 2048. This will only reset the limit for your current shell and the number you specify must not exceed the hard limit

Each operating system has a different hard limit setup in a configuration file. For instance, the hard open file limit on Solaris can be set on boot from /etc/system.

set rlim_fd_max = 166384
set rlim_fd_cur = 8192

On OS X, this same data must be set in /etc/sysctl.conf.

kern.maxfilesperproc=166384
kern.maxfiles=8192

Under Linux, these settings are often in /etc/security/limits.conf.

There are two kinds of limits:

  • soft limits are simply the currently enforced limits
  • hard limits mark the maximum value which cannot be exceeded by setting a soft limit

Soft limits could be set by any user while hard limits are changeable only by root. Limits are a property of a process. They are inherited when a child process is created so system-wide limits should be set during the system initialization in init scripts and user limits should be set during user login for example by using pam_limits.

There are often defaults set when the machine boots. So, even though you may reset your ulimit in an individual shell, you may find that it resets back to the previous value on reboot. You may want to grep your boot scripts for the existence ulimit commands if you want to change the default.

Tuesday, June 1, 2021
 
Slinky
answered 7 Months ago
90

Depending on your theme customization, you could try to add this in function.php file located in your active child theme or theme:

function custom_excerpt_more($more) {
    global $post;
    return '<a class="moretag" href="'. get_permalink($post->ID) . '">' . __("Your Read More Link Text", "your_theme_slug") . '</a>';
}
add_filter( 'excerpt_more', 'custom_excerpt_more' );

WP codex: Customizing the Read More

Wednesday, March 31, 2021
 
akohout
answered 9 Months ago
81

You can use the source indexing feature of the Debugging Tools for Windows, which will save references to the appropriate revisions of the files in your source repository as an alternate stream in the PDB file.

Monday, August 2, 2021
 
Enlico
answered 4 Months ago
56

DECLARE_WORK is primarily for static work items, where no instance data is needed. You want INIT_WORK. Use this to initialize a work_struct that is a member of another structure (of your choosing), then use container_of in the callback to get the pointer to the containing structure. This container_of pattern is extremely common in the Linux kernel, so it's a good idea to get familiar with it!

You can see an example of this with wl1271_netstack_work - take a look at the initialization point and the callback.

Thursday, September 23, 2021
 
Nicolas Le Thierry d'Ennequin
answered 2 Months ago
59

I faced the same error with Docker. The problem was that I forgot to include a .dockerignore file and my node_modules were being copied into the container.

Try creating a .dockerignore file in the root of your project (next to your Dockerfile) with e.g.:

node_modules
npm-debug.log
Dockerfile
.dockerignore
.git
.gitignore
Thursday, October 7, 2021
 
felipsmartins
answered 2 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :  
Share