LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-27-2008, 10:48 AM   #1
guarriman
Member
 
Registered: Nov 2004
Posts: 101

Rep: Reputation: 15
mmap cache can't open foo.php - Too many open files


Hi.

Using Apache version 2.2.3 on a 'Linux CentOS' VPS, my webpages are very
slow and I get this error messages on my 'error_log' file:

Code:
[Wed Mar 26 13:05:39 2008] [warn-phpd] mmap cache can't open
/var/www/vhosts/foo.com/httpdocs/classes/Threads.php - Too many open files (pid 17650)
[Wed Mar 26 13:05:42 2008] [warn-phpd] mmap cache can't open
/var/www/vhosts/foo.com/httpdocs/classes/User.php - Too many open files (pid 17650)
[Wed Mar 26 13:05:46 2008] [warn-phpd] mmap cache can't open
/var/www/vhosts/foo.com/httpdocs/lib/Functions.php - Too many open files (pid 17650)
Some data of my server:

Code:
[]# free -m
total used free shared buffers cached
Mem: 2693 267 2425 0 0 0
-/+ buffers/cache: 267 2425
Swap: 0 0 0

[]# ulimit -m
unlimited
As you see, my Host provider gave me a VPS server with Swap=0.

I've got PHP 5.2.5 and APC (a Cache System) 3.0.17.

Thank you very much.
 
Old 03-28-2008, 04:00 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Check the maximum number of open files allowed to the user:
Code:
ulimit -n
Then you can try to increase this value up to the number in /proc/sys/fs/file-max, that is the upper limit provided by the kernel (but I strongly suggest to keep the user limit below this number).
 
Old 03-28-2008, 12:39 PM   #3
guarriman
Member
 
Registered: Nov 2004
Posts: 101

Original Poster
Rep: Reputation: 15
I'd like to configure my "ulimit" and change the value:
Code:
ulimit -n 16384
It works perfectly if I type it on the shell, but it doesn't work if I write it within a shell script (/etc/rc.d/init.d/httpd) or within '/etc/rc.local'

The idea is changing it each time the server starts. Any suggestion?
 
Old 12-16-2013, 01:03 PM   #4
alfanux
LQ Newbie
 
Registered: Dec 2013
Posts: 2

Rep: Reputation: Disabled
Smile /etc/rc.local

Put in /etc/rc.local at the end of this file this

ulimit -n 16384

It's because /etc/rc.local is the last script

alfanux
hostingred.com
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant open .dat files (video) by double clicking though I can open it by openwith.. ravi_npatty Linux - Newbie 17 07-31-2007 08:19 PM
Prompted to Open/Save php files sharky Linux - Server 5 03-04-2007 02:00 AM
How do I open appleworks files (.cwk) in open office? mkpovak Linux - Desktop 1 08-08-2006 04:03 AM
how to open files from a network server from open office or any apps reycapoy Linux - Software 4 01-26-2006 07:00 PM
Open Office does not open large files linuxfond Linux - Newbie 8 09-26-2004 03:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration