Home  >  Article  >  Backend Development  >  There are too many session files in php, the inode is used up, and the solution to the problem that apache cannot run

There are too many session files in php, the inode is used up, and the solution to the problem that apache cannot run

WBOY
WBOYOriginal
2016-07-25 08:58:301018browse
  1. session.save_handler = eaccelerator
Copy code

The premise is that: eaccelerator has been installed.

2. Use session hierarchical directory Modify;session.save_path = "/tmp"

Modified to:

  1. session.save_path = "2;/tmp/session"
Copy the code

Use the secondary hash directory under the /tmp/session directory to store the session

php will not automatically create a hash directory. You need to manually create the corresponding directory and give permissions:

  1. find /tmp/session -amin +180 -exec rm -rf {} ;
Copy code

Instructions: Clean up once an hour, clean session files older than 3 hours.

The third method I currently use works well. You can also try the first one and see the effect.

Anyone who has a good method is welcome to share it with the Programmer’s Home for everyone to discuss together, haha.



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn