Simple Machines Community Forum

SMF Support => Server Performance and Configuration => Topic started by: spiros on May 20, 2020, 08:15:52 AM

Title: Memcache and sessions
Post by: spiros on May 20, 2020, 08:15:52 AM
Testing with both Memcache and Memcached I could get SMF to see the former, but not the latter, so my guess here is that SMF supports only Memcache. Is this correct?

Does it support storing sessions? If that is correct, how do I set it up? Is it on php.ini like this:

session.save_handler = memcache
session.save_path = "tcp://localhost:11211"

https://www.php.net/manual/en/memcached.sessions.php
Title: Re: Memcache and sessions
Post by: Arantor on May 20, 2020, 08:53:47 AM
Correct, there are two different connectors to memcache, one with a d, one without, 2.0 only supports the older one.

SMF's configuration for sessions is either to use the database or use whatever PHP.ini sets, so if you configure sessions in php.ini and then turn off DB sessions in SMF that should do it.
Title: Re: Memcache and sessions
Post by: spiros on May 20, 2020, 12:00:27 PM
I did it. And unchecked "Use database driven sessions".
But now I cannot log out (or log in in a different browser).

AN ERROR HAS OCCURRED!
Session verification failed. Please try logging out and back in again, and then try again.


Reverting to old settings in php.ini recovered log in.
Title: Re: Memcache and sessions
Post by: Arantor on May 20, 2020, 01:22:55 PM
Hmm, weird, because that should be all you need to do. But it's been a while since I did this. :(
Title: Re: Memcache and sessions
Post by: drewactual on May 20, 2020, 04:35:05 PM
MemcacheD  works fine for me and sessions... however you're configured wrong.. simply the IP and the port... self would read:

sessions_save_path = "127.0.0.1:11211"

You can check out the php docs, but I'm almost certain this is the case... one uses http:// leading into the path, and one doesn't.

While using memcached I also use database driven sessions, or, at least irs checked. 
Title: Re: Memcache and sessions
Post by: Arantor on May 20, 2020, 04:39:27 PM
I couldn't remember for sure; it looked right because if you're using Redis, you do use it with a tcp:// path and I couldn't remember how memcache did it because I moved on from memcache some time ago.

But it wouldn't surprise me if you did it that way rather than with tcp:// or similar.
Title: Re: Memcache and sessions
Post by: drewactual on May 20, 2020, 04:42:38 PM
I'm sorry I said http when I meant tcp... but I checked it and with memcacheD you simply use IP and Port... this was something that stopped me cold for a while, but since that little discovery its been smooth (knock on wood)  :-)
Title: Re: Memcache and sessions
Post by: drewactual on May 20, 2020, 08:18:16 PM
not on phone now... can type proper response:

memcache DOES use the tcp connection... memcacheD does NOT.  in your httpd.conf, htaccess, or php.ini set:


php_value session.gc_maxlifetime = 96000
php_value session.save_path = "127.0.0.1:11211"
php_value session.save_handler = "memcached"
php_value session.cookie_lifetime = "96000"
php_value session.cookie_secure = "1"
php_value session.entropy_file = "/dev/urandom"
php_value session.entropy_length = "32"
php_value session.hash_function = "0"
php_value session.name = "yoursessioncookiename"
php_flag session.use_cookies = On
php_flag session.use_only_cookies = On
php_flag session.use_strict_mode = On
php_flag session.use_trans_sid = Off


^that's all the code related to sessions.


for SMF i have a separate cookie name, and i have database sessions enabled... 

IF IF IF i was using memachE, it would be:


php_value session.gc_maxlifetime = 96000
php_value session.save_path = "tcp://127.0.0.1:11211"
php_value session.save_handler = "memcache"
php_value session.cookie_lifetime = "96000"
php_value session.cookie_secure = "1"
php_value session.entropy_file = "/dev/urandom"
php_value session.entropy_length = "32"
php_value session.hash_function = "0"
php_value session.name = "yoursessioncookiename"
php_flag session.use_cookies = On
php_flag session.use_only_cookies = On
php_flag session.use_strict_mode = On
php_flag session.use_trans_sid = Off
Title: Re: Memcache and sessions
Post by: drewactual on May 20, 2020, 08:27:50 PM
oh... and make certain memcache(d) is running... it doesn't hurt anything to fire it off..

memcached -d -m 512 -l 127.0.0.1 -p 11211 -u nobody


now i can't remember this next bit but i know it's important.. Arantor will know it off the top of his head... but...

MPMWorker running FPM uses 'nobody'... I 'think' a prefork type configuration, or a fastcgi, uses 'user'... i don't know how your server is configured, but if i recall correctly that is important to assign the session to the proper user (either 'user' or 'nobody'), and i KNOW it's tricky with files, else php will send some users off to encounter a 403 instead of whatever page their seeking.
Title: Re: Memcache and sessions
Post by: spiros on May 21, 2020, 02:16:32 AM
Let me summarize this, to see if I got it right. I use SMF 2, hence it is only MemcachE I can use. In that case, I need to:

1. check on SMF "Use database driven sessions". (this was already so, before MemcachE)
2. Use these settings in httpd.conf, htaccess, or php.ini (does it make a difference which one? Would setting a cookie in php.ini affect other sites? The server has other sites too)

php_value session.gc_maxlifetime = 96000
php_value session.save_path = "tcp://127.0.0.1:11211"
php_value session.save_handler = "memcache"
php_value session.cookie_lifetime = "96000"
php_value session.cookie_secure = "1"
php_value session.entropy_file = "/dev/urandom"
php_value session.entropy_length = "32"
php_value session.hash_function = "0"
php_value session.name = "yoursessioncookiename"
php_flag session.use_cookies = On
php_flag session.use_only_cookies = On
php_flag session.use_strict_mode = On
php_flag session.use_trans_sid = Off


Do I need to use a different cookie name (both on SMF and php.ini?) that the one I have set now on SMF?
Title: Re: Memcache and sessions
Post by: spiros on May 21, 2020, 04:35:20 AM
Also, I see no quotes in this value:
php_value session.gc_maxlifetime = 96000

But quotes in this one:
php_value session.cookie_lifetime = "96000"

Is this deliberate? Does it make a difference?
Title: Re: Memcache and sessions
Post by: drewactual on May 21, 2020, 01:39:30 PM
i also run (primarily) 2.0.x.... i use memcacheD with no problems for sessions.  i use the specific code provided in my httpd.conf file...

IF you are using a server with multiple sites AND while using httpd.conf, you'll have to add that code to the virtualhost applicable to that IP address and port.. example:

<VirtualHost 127.0.0.1:443>
   php_value session.gc_maxlifetime = 96000
   php_value session.save_path = "127.0.0.1:11211"
   php_value session.save_handler = "memcached"
   php_value session.cookie_lifetime = "96000"
   php_value session.cookie_secure = "1"
   php_value session.entropy_file = "/dev/urandom"
   php_value session.entropy_length = "32"
   php_value session.hash_function = "0"
   php_value session.name = "yoursessioncookiename"
   php_flag session.use_cookies = On
   php_flag session.use_only_cookies = On
   php_flag session.use_strict_mode = On
   php_flag session.use_trans_sid = Off
</VirtualHost>


IF you're using a shared IP address, you'd want:

<IfModule php7_module>
<Directory "/home/cccccccc/Public"> <-or absolute to your directory
php_value session.gc_maxlifetime = 96000
php_value session.save_path = "127.0.0.1:11211"
php_value session.save_handler = "memcached"
php_value session.cookie_lifetime = "96000"
php_value session.cookie_secure = "1"
php_value session.entropy_file = "/dev/urandom"
php_value session.entropy_length = "32"
php_value session.hash_function = "0"
php_value session.name = "yoursessionname"
php_flag session.use_cookies = On
php_flag session.use_only_cookies = On
php_flag session.use_strict_mode = On
php_flag session.use_trans_sid = Off
</Directory>
</IfModule>


THAT^ is if you use this in your httpd.conf.... but let's just be simple? add it to your htaccess.... make sure and put it in a php directive... example:


<IfModule php7_module>
php_value session.gc_maxlifetime = 96000
php_value session.save_path = "127.0.0.1:11211"
php_value session.save_handler = "memcached"
php_value session.cookie_lifetime = "96000"
php_value session.cookie_secure = "1"
php_value session.entropy_file = "/dev/urandom"
php_value session.entropy_length = "32"
php_value session.hash_function = "0"
php_value session.name = "yourseesionname"
php_flag session.use_cookies = On
php_flag session.use_only_cookies = On
php_flag session.use_strict_mode = On
php_flag session.use_trans_sid = Off
</IfModule>


as far as 'quoted' directives, i don't know why they are like this... you can use boolean in most of these, which is either On, or 1, OR, Off or 0.. I mixed them when for simplicity i should not have.

it's my understanding that directives that are either explicitly boolean (on or off) OR expect ONLY a number don't have to be in quotes, where directives that can possibly have expressions more than just on or off, and more than just a number can be interjected HAVE to be in quotes... i could easily be wrong about this, but the precise code provided is how i'm set up...   

about sessions names: PHP will begin a session as soon as a user touches your site.. that session/cookie is independent of SMF..... IF they log into SMF they will have another cookie added to this, which is the one you set in the SMF backside.  as a for instance, if you click the little lock (if using chrome) on this site you'll be able to list the cookies in use.. you'll see the one following you around as a SMF user, AND you'll see the one php assigns to keep up with what you've done/seen and not.... there are at least two... you'll want them to have different names... you'll also def want sessions.use_trans_sid set to OFF (so it doesn't show the hash in the URL).

that's pretty much all there is to it...

well.... we can get complicated too:

IF you have a device that relies on flat sessions files elsewhere, you can change it in that directory by using user.ini or a lower htaccess... for instance, one of my sites has SMF up front and WP behind it- in a sub-directory... a shopping cart software i use in the WP relies on flat files for sessions, and dynamic (memcache(d)) isn't an option... .so... in user.ini or htaccess for that directory only, i change the php directive to use flat files again.... in only that directory... it works 'very' well. 
Title: Re: Memcache and sessions
Post by: spiros on May 21, 2020, 02:20:07 PM
Quote from: Arantor on May 20, 2020, 08:53:47 AM
Correct, there are two different connectors to memcache, one with a d, one without, 2.0 only supports the older one.

Quote from: drewactual on May 21, 2020, 01:39:30 PM
i also run (primarily) 2.0.x.... i use memcacheD with no problems for sessions.  i use the specific code provided in my httpd.conf file...

I understand Memcache is the older version? In my server Memcached was not recognized by SMF, Memcache was.
Title: Re: Memcache and sessions
Post by: Arantor on May 21, 2020, 02:28:35 PM
There's a lot of confusion here.

There are two *connectors* to memcache - SMF 2.0 recognises the older one for the purposes of caching only. SMF 2.1 recognises both for caching. Neither SMF 2.0 or 2.1 consciously offload sessions to anything; the DB sessions simply says 'use the database or let PHP do whatever PHP is configured to do'. The idea being that if you use memcache for sessions you set this up in php.ini and turn off DB sessions so it all gets handled by PHP.

To be more helpfully confusing, memcache in all flavours has a process called memcached which is the daemon for it.
Title: Re: Memcache and sessions
Post by: drewactual on May 21, 2020, 02:29:56 PM
mine is running memcached... for sessions.. memcache for cache... SMF doesn't recognize memcacheD- true- for caching.. the SERVER recognized memcacheD, and that is all you need for sessions handling, which is done outside of SMF.  SMF requests or sends the information- either to flat files or to dynamic.. it doesn't care where it goes or how it's handled so long as it's there when it asks- which it is. 

i don't have my head all the way around using 'database driven sessions', but memcacheD works fine with it either checked or not. 

again, and i don't want to sound like a broken record- but make sure it's 'on' and functioning. 
Title: Re: Memcache and sessions
Post by: drewactual on May 21, 2020, 02:34:35 PM
i am curious as to how Spiros loaded memcached... i had to jump through hoops to get it running on apache2.4 and php7+...

Title: Re: Memcache and sessions
Post by: Arantor on May 21, 2020, 02:35:32 PM
And this is why I switched to Redis, none of this drama.
Title: Re: Memcache and sessions
Post by: drewactual on May 21, 2020, 02:37:25 PM
and from what i understand redis is superior... i'd like to know how if you find the time at some point... i always appreciate your knowledge, Arantor.
Title: Re: Memcache and sessions
Post by: spiros on May 21, 2020, 02:43:42 PM
Quote from: Arantor on May 21, 2020, 02:35:32 PM
And this is why I switched to Redis, none of this drama.

Did you use this mod? As far as I know SMF 2 does not support it. https://custom.simplemachines.org/mods/index.php?mod=4119

Quote from: Arantor on May 21, 2020, 02:28:35 PM
There are two *connectors* to memcache - SMF 2.0 recognises the older one for the purposes of caching only. SMF 2.1 recognises both for caching. Neither SMF 2.0 or 2.1 consciously offload sessions to anything

I was referring to SMF > Administration Center > Server Settings > Caching displaying "SMF has detected that your server has Memcached installed.", I take this to mean that Memcache(d) is doing something there, even if sessions are not set up. Please correct me if I am wrong.
Title: Re: Memcache and sessions
Post by: drewactual on May 21, 2020, 02:49:11 PM
it has recognized memcache is available... but don't conflate that with sessions... two different jobs being done by 'somewhat' the same 'critter'.

i hung the php_memcache file... there are three more plus configuration for them to get memcacheD working as a sessions handler... now there may be a package NOW in the RPM library, but there wasn't when i implemented it a couple years ago (when i jumped to apache2.4 and php7). 

i feel it is worth it... it takes quite a load off the server and HDD having to write constantly- which also means speed... i hear redis is even faster and not by a small margin. 
Title: Re: Memcache and sessions
Post by: Arantor on May 21, 2020, 02:53:44 PM
QuoteI was referring to SMF > Administration Center > Server Settings > Caching displaying "SMF has detected that your server has Memcached installed.", I take this to mean that Memcache(d) is doing something there, even if sessions are not set up. Please correct me if I am wrong.

It has detected the memcache (no d) connector -> https://www.php.net/memcache (supported for caching in 2.0 and 2.1)
And the memcached (with d) connector -> https://www.php.net/memcached (supported for caching in 2.1 only)

SMF having detected or not detected this has zero bearing on sessions.


Re Redis... did I use an existing mod? No, I rolled my own. No, you can't use it with SMF because it wasn't written for SMF, it was written for a fork meaning that your ability to use it is limited. However if for some reason you did want to look, here's the class I wrote (https://github.com/StoryBB/StoryBB/blob/master/Sources/StoryBB/Cache/Redis.php).

Redis for sessions works the same way as Memcache, you configure it in the php.ini via TCP.
Title: Re: Memcache and sessions
Post by: spiros on May 21, 2020, 03:23:52 PM
Thanks again, Arantor.

I've put this on my htaccess. Not sure though if that has taken effect. Checking the cookies through the browser lock icon does not include the one I set for memcache (memcachecookiesmf2).

https://www.translatum.gr/forum/index.php

<IfModule php7_module>
php_value session.gc_maxlifetime = "96000"
php_value session.save_path = "tcp://127.0.0.1:11211"
php_value session.save_handler = "memcache"
php_value session.cookie_lifetime = "96000"
php_value session.cookie_secure = "1"
php_value session.entropy_file = "/dev/urandom"
php_value session.entropy_length = "32"
php_value session.hash_function = "0"
php_value session.name = "memcachecookiesmf2"
php_flag session.use_cookies = On
php_flag session.use_only_cookies = On
php_flag session.use_strict_mode = On
php_flag session.use_trans_sid = Off
</IfModule>


This is what I see in my php.info

memcache
memcache support   enabled
Version   4.0.2
Revision   $Revision$

memcache.allow_failover   1   1
memcache.chunk_size   32768   32768
memcache.compress_threshold   20000   20000
memcache.default_port   11211   11211
memcache.hash_function   crc32   crc32
memcache.hash_strategy   consistent   consistent
memcache.lock_timeout   15   15
memcache.max_failover_attempts   20   20
memcache.prefix_host_key   0   0
memcache.prefix_host_key_remove_subdomain   0   0
memcache.prefix_host_key_remove_www   1   1
memcache.prefix_static_key   no value   no value
memcache.protocol   ascii   ascii
memcache.redundancy   1   1
memcache.session_prefix_host_key   0   0
memcache.session_prefix_host_key_remove_subdomain   0   0
memcache.session_prefix_host_key_remove_www   1   1
memcache.session_prefix_static_key   no value   no value
memcache.session_redundancy   2   2
memcache.session_save_path   no value   no value
Title: Re: Memcache and sessions
Post by: drewactual on May 21, 2020, 03:35:19 PM
If you're using OPCache, you'll need to reset it.  Otherwise, dump your browser cache.
Title: Re: Memcache and sessions
Post by: spiros on May 21, 2020, 03:49:42 PM
I used this to reset OPCache. Restarted Apache, php-fpm, emptied browser cache. No change.

<?php
opcache_reset
();
?>
Title: Re: Memcache and sessions
Post by: drewactual on May 21, 2020, 04:40:51 PM
Weird... check your directory where sessions were/are stored when using files, and see if it has very recent entries?
Title: Re: Memcache and sessions
Post by: Herman's Mixen on May 21, 2020, 04:48:25 PM
Just a throw back here look for your own distro wich you use here just an example

https://devdocs.magento.com/guides/v2.3/config-guide/memcache/memcache_ubuntu.html
Title: Re: Memcache and sessions
Post by: spiros on May 22, 2020, 04:17:45 AM
Quote from: drewactual on May 21, 2020, 04:40:51 PM
Weird... check your directory where sessions were/are stored when using files, and see if it has very recent entries?

Not sure what that is. In php.ini I see:
session.save_path   /var/cpanel/php/sessions/ea-php71   /var/cpanel/php/sessions/ea-php72

And both are empty.

I removed from htaccess and added in Pre VirtualHost Include in Apache using the path to the forum.

Quote from: Herman's Mixen on May 21, 2020, 04:48:25 PM
Just a throw back here look for your own distro wich you use here just an example

I tried the script listed there, it returns HTTP ERROR 500.
Checking stats items via cmd gives:

STAT items:25:direct_reclaims 2873
STAT items:25:hits_to_hot 1109
STAT items:25:hits_to_warm 1284
STAT items:25:hits_to_cold 267
STAT items:25:hits_to_temp 0
STAT items:26:number 76
STAT items:26:number_hot 8
STAT items:26:number_warm 1
STAT items:26:number_cold 67
STAT items:26:age_hot 1383
STAT items:26:age_warm 3166
STAT items:26:age 7861
STAT items:26:evicted 1769
STAT items:26:evicted_nonzero 1769
STAT items:26:evicted_time 7826
STAT items:26:outofmemory 0
STAT items:26:tailrepairs 0
STAT items:26:reclaimed 1352
STAT items:26:expired_unfetched 1464
STAT items:26:evicted_unfetched 1225
STAT items:26:evicted_active 0
STAT items:26:crawler_reclaimed 391
STAT items:26:crawler_items_checked 9676
STAT items:26:lrutail_reflocked 0
STAT items:26:moves_to_cold 2715
STAT items:26:moves_to_warm 85
STAT items:26:moves_within_lru 22
STAT items:26:direct_reclaims 1769
STAT items:26:hits_to_hot 742
STAT items:26:hits_to_warm 49
STAT items:26:hits_to_cold 229
STAT items:26:hits_to_temp 0
STAT items:27:number 60
STAT items:27:number_hot 11
STAT items:27:number_warm 2
STAT items:27:number_cold 47
STAT items:27:age_hot 1282
STAT items:27:age_warm 462
STAT items:27:age 7451
STAT items:27:evicted 1231
STAT items:27:evicted_nonzero 1231
STAT items:27:evicted_time 8017
STAT items:27:outofmemory 0
STAT items:27:tailrepairs 0
STAT items:27:reclaimed 1119
STAT items:27:expired_unfetched 1085
STAT items:27:evicted_unfetched 826
STAT items:27:evicted_active 0
STAT items:27:crawler_reclaimed 269
STAT items:27:crawler_items_checked 7218
STAT items:27:lrutail_reflocked 0
STAT items:27:moves_to_cold 1857
STAT items:27:moves_to_warm 102
STAT items:27:moves_within_lru 1104
STAT items:27:direct_reclaims 1231
STAT items:27:hits_to_hot 661
STAT items:27:hits_to_warm 1301
STAT items:27:hits_to_cold 208
STAT items:27:hits_to_temp 0
STAT items:28:number 36
STAT items:28:number_hot 7
STAT items:28:number_warm 0
STAT items:28:number_cold 29
STAT items:28:age_hot 1445
STAT items:28:age_warm 0
STAT items:28:age 12075
STAT items:28:evicted 485
STAT items:28:evicted_nonzero 485
STAT items:28:evicted_time 21750
STAT items:28:outofmemory 0
STAT items:28:tailrepairs 0
STAT items:28:reclaimed 2171
STAT items:28:expired_unfetched 3180
STAT items:28:evicted_unfetched 319
STAT items:28:evicted_active 0
STAT items:28:crawler_reclaimed 1527
STAT items:28:crawler_items_checked 14271
STAT items:28:lrutail_reflocked 0
STAT items:28:moves_to_cold 2221
STAT items:28:moves_to_warm 215
STAT items:28:moves_within_lru 209
STAT items:28:direct_reclaims 485
STAT items:28:hits_to_hot 1779
STAT items:28:hits_to_warm 343
STAT items:28:hits_to_cold 241
STAT items:28:hits_to_temp 0
STAT items:29:number 36
STAT items:29:number_hot 6
STAT items:29:number_warm 2
STAT items:29:number_cold 28
STAT items:29:age_hot 811
STAT items:29:age_warm 26
STAT items:29:age 12149
STAT items:29:evicted 370
STAT items:29:evicted_nonzero 370
STAT items:29:evicted_time 23414
STAT items:29:outofmemory 0
STAT items:29:tailrepairs 0
STAT items:29:reclaimed 1583
STAT items:29:expired_unfetched 1800
STAT items:29:evicted_unfetched 223
STAT items:29:evicted_active 0
STAT items:29:crawler_reclaimed 558
STAT items:29:crawler_items_checked 4795
STAT items:29:lrutail_reflocked 6
STAT items:29:moves_to_cold 1415
STAT items:29:moves_to_warm 243
STAT items:29:moves_within_lru 4181
STAT items:29:direct_reclaims 370
STAT items:29:hits_to_hot 488
STAT items:29:hits_to_warm 11779
STAT items:29:hits_to_cold 366
STAT items:29:hits_to_temp 0
STAT items:30:number 13
STAT items:30:number_hot 2
STAT items:30:number_warm 1
STAT items:30:number_cold 10
STAT items:30:age_hot 1578
STAT items:30:age_warm 2865
STAT items:30:age 10254
STAT items:30:evicted 160
STAT items:30:evicted_nonzero 160
STAT items:30:evicted_time 26761
STAT items:30:outofmemory 0
STAT items:30:tailrepairs 0
STAT items:30:reclaimed 374
STAT items:30:expired_unfetched 222
STAT items:30:evicted_unfetched 91
STAT items:30:evicted_active 0
STAT items:30:crawler_reclaimed 142
STAT items:30:crawler_items_checked 1560
STAT items:30:lrutail_reflocked 0
STAT items:30:moves_to_cold 528
STAT items:30:moves_to_warm 53
STAT items:30:moves_within_lru 30
STAT items:30:direct_reclaims 160
STAT items:30:hits_to_hot 255
STAT items:30:hits_to_warm 57
STAT items:30:hits_to_cold 189
STAT items:30:hits_to_temp 0
STAT items:31:number 16
STAT items:31:number_hot 0
STAT items:31:number_warm 0
STAT items:31:number_cold 16
STAT items:31:age_hot 0
STAT items:31:age_warm 0
STAT items:31:age 11962
STAT items:31:evicted 181
STAT items:31:evicted_nonzero 181
STAT items:31:evicted_time 3252
STAT items:31:outofmemory 0
STAT items:31:tailrepairs 0
STAT items:31:reclaimed 1900
STAT items:31:expired_unfetched 2352
STAT items:31:evicted_unfetched 144
STAT items:31:evicted_active 0
STAT items:31:crawler_reclaimed 750
STAT items:31:crawler_items_checked 2137
STAT items:31:lrutail_reflocked 0
STAT items:31:moves_to_cold 2049
STAT items:31:moves_to_warm 53
STAT items:31:moves_within_lru 17
STAT items:31:direct_reclaims 181
STAT items:31:hits_to_hot 273
STAT items:31:hits_to_warm 26
STAT items:31:hits_to_cold 144
STAT items:31:hits_to_temp 0
STAT items:32:number 12
STAT items:32:number_hot 0
STAT items:32:number_warm 0
STAT items:32:number_cold 12
STAT items:32:age_hot 0
STAT items:32:age_warm 0
STAT items:32:age 9329
STAT items:32:evicted 60
STAT items:32:evicted_nonzero 60
STAT items:32:evicted_time 4198
STAT items:32:outofmemory 0
STAT items:32:tailrepairs 0
STAT items:32:reclaimed 1683
STAT items:32:expired_unfetched 2194
STAT items:32:evicted_unfetched 48
STAT items:32:evicted_active 0
STAT items:32:crawler_reclaimed 895
STAT items:32:crawler_items_checked 2849
STAT items:32:lrutail_reflocked 0
STAT items:32:moves_to_cold 2312
STAT items:32:moves_to_warm 98
STAT items:32:moves_within_lru 25
STAT items:32:direct_reclaims 60
STAT items:32:hits_to_hot 258
STAT items:32:hits_to_warm 28
STAT items:32:hits_to_cold 272
STAT items:32:hits_to_temp 0
STAT items:33:number 2
STAT items:33:number_hot 0
STAT items:33:number_warm 0
STAT items:33:number_cold 2
STAT items:33:age_hot 0
STAT items:33:age_warm 0
STAT items:33:age 9329
STAT items:33:evicted 4
STAT items:33:evicted_nonzero 4
STAT items:33:evicted_time 196
STAT items:33:outofmemory 0
STAT items:33:tailrepairs 0
STAT items:33:reclaimed 214
STAT items:33:expired_unfetched 196
STAT items:33:evicted_unfetched 4
STAT items:33:evicted_active 0
STAT items:33:crawler_reclaimed 130
STAT items:33:crawler_items_checked 322
STAT items:33:lrutail_reflocked 0
STAT items:33:moves_to_cold 427
STAT items:33:moves_to_warm 76
STAT items:33:moves_within_lru 8
STAT items:33:direct_reclaims 4
STAT items:33:hits_to_hot 26
STAT items:33:hits_to_warm 8
STAT items:33:hits_to_cold 235
STAT items:33:hits_to_temp 0
Title: Re: Memcache and sessions
Post by: drewactual on May 22, 2020, 10:16:00 AM
In your phpinfo there is no save path configured either for the server or site...

Check the line sessions.save_path... it may use different context that how we've set it up... again, I used memcacheD for sessions freeing memcache for caching... I didn't see memcached loaded on your phpinfo... the version that can be ported to php7, I thought, was for cache only and didn't have sessions capability...

I can't tell you I've ever got memcache to work handling sessions but memcached has worked for several years now.  After looking last night it HAS been ported to 7.2php and is available in the RPM library, and can be 'yummed" right in...

If you bring in memcacheD, you can have it running sessions in just a few minutes with the info provided already... the only thing not here is the four lines of configuration.... that is easy enough, though.

Title: Re: Memcache and sessions
Post by: drewactual on May 28, 2020, 01:09:15 PM
I ran across a snippet last night and intended to provide it here.. but, alas, SOMETHING SHINY!!! and the link is forgotten...

At any rate, it read that Memcache CAN be ported to php7 but it isn't suitable for anything but cache.  Not without a lot of effort and coding can it be used for sessions.  MEMCACHED, however, can out of the box.  The 'box' is available in most RPM libraries now.  And of it isn't, it can be yummed in from several certified sites.