2

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?

1 Answers1

0

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?

symcbean
  • 19,931
  • 1
  • 29
  • 49
  • 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 '14 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 '14 at 13:18
  • I storing sessions like: $_SESSION['chat_login']['login'] == 1 – TKVideoChat Mar 31 '14 at 13:22
  • Q: have you got MySQL with a massive buffer pool? A: innodb buffer pool size 47.684 GiB – TKVideoChat Mar 31 '14 at 13:25
  • No, that's not how you are storing the sessions. Please read the manual. – symcbean Mar 31 '14 at 14:00
  • @TKVideoChat In case you save your sessions on HDDs, consider using SSDs, the difference is dramatic. SSD-raids might even max out the mainboard's i/o :) – Sliq Jan 21 '15 at 08:06