Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have:

CPU: 2 x Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz (2600.06-MHz K8-class CPU)

128 GB RAM

FreeBSD OS

session files stored in RAM

each session file is 1...10 kb

gc_maxlifetime = 1440

quantity of session files is: 21000 (100M RAM)

when I change gc_maxlifetime to = 3600 quantity of session files changes to: 55000 (250M RAM)

After it site start opening were slowly.

Site start working slowly only after changing gc_maxlifetime to = 3600. When gc_maxlifetime = 1440 all works perfectly.

So, it happens because of huge amount of session files.

Would should I do to make it work faster?

share|improve this question
    
It all depends on your application and the way it uses sessions. –  Tero Kilkanen Mar 31 at 9:15
    
How are you storing sessions? –  Michael Hampton Mar 31 at 11:33
    
I storing sessions like: $_SESSION['chat_login']['login'] == 1 –  TKVideoChat Mar 31 at 13:20

1 Answer 1

Use smaller sessions. Don't store them in RAM. Buy more RAM. Or as you've already discovered, use a lower gc_maxlifetime.

However 100M is only a tiny fraction of the memory - which rather suggests something else is very badly configured and using up all the memory - have you got MySQL with a massive buffer pool?

share|improve this answer
    
I dont have a problem with RAM. I Have 67GB free RAM. I have problem with site speed when session files more then 30 000 –  TKVideoChat Mar 31 at 13:15
    
It might have been helpful if you had mentioned that. If you've got enough free memory then you've got a problem with indexing/space allocation for the sessins. But you didn't say what method you use for that. –  symcbean Mar 31 at 13:18
    
I storing sessions like: $_SESSION['chat_login']['login'] == 1 –  TKVideoChat Mar 31 at 13:22
    
Q: have you got MySQL with a massive buffer pool? A: innodb buffer pool size 47.684 GiB –  TKVideoChat Mar 31 at 13:25
    
No, that's not how you are storing the sessions. Please read the manual. –  symcbean Mar 31 at 14:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.