User Activity by Xon

User Activity by Xon 2.8.2

No permission to download

Andrus

Member
It depends, are you going to have a thread with +100 people in it at once? if not, you aren't going to notice

I often have several 100 users on a single thread at once. Very often, in-fact. I am on a dedicated server solution using LiteSpeed/LScache and am also using LiteSpeed Cache 2.1.1 addon. When it comes to server side and cache stuff I am fairly ignorant.

First, do I still need to install Redis Cache on the server along with installing your Redis addon to my Xenforo install? If so, would I need to uninstall the LiteSpeed Cache 2.1.1 addon? I noticed that memcached is also installed on my webserver. Is that going to cause issues?
 

Xon

Well-known member
First, do I still need to install Redis Cache on the server along with installing your Redis addon to my Xenforo install? If so, would I need to uninstall the LiteSpeed Cache 2.1.1 addon? I noticed that memcached is also installed on my webserver. Is that going to cause issues?
You would need to setup Redis, and configure XenForo caching to use it via my Redis Cache add-on;

Code:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']  = array(
        'server' => '127.0.0.1',
        'port' => 6379,
        'compress_data' => 6,
    );

Install Redis, deploy the Redis Cache add-on, configure config.php to use it as a provide, then install the Redis Cache add-on itself.

You shouldn't need to uninstall LiteSpeed Cache 2.1.1 addon, I'm not sure if that add-on directly uses memcache or goes via the XF caching system
 

cyberdyne

Member
Hello,
i have huge forum with >3-5k online users at peak.
forum node list counters are slow. main page generates 7-9 secs.
after analysis i found a problem query and built an index.

You can add this to the next update.

result here:
195434
 
Last edited:

Andrus

Member
You would need to setup Redis, and configure XenForo caching to use it via my Redis Cache add-on;

Code:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']  = array(
        'server' => '127.0.0.1',
        'port' => 6379,
        'compress_data' => 6,
    );

Install Redis, deploy the Redis Cache add-on, configure config.php to use it as a provide, then install the Redis Cache add-on itself.

You shouldn't need to uninstall LiteSpeed Cache 2.1.1 addon, I'm not sure if that add-on directly uses memcache or goes via the XF caching system


Thanks for your assistance, Xon!

So first I installed Redis Cache 4.2.0 on the webserver (but not my db server).
I just took a look at my config.php file and it contains the following:
Code:
$config['cache']['sessions'] = true;

$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Memcached';
$config['cache']['config'] = [
    'server' => '127.0.0.1'
];

Should I overwrite the memcached code with the Redis code that you provided, or add it above/below the Memcached section in case the LiteSpeed addon makes use of it?

I am just concerned with the possibility of either creating a conflict, or eliminating a necessary function. Like I said, I am pretty ignorant about that stuff.
 
Last edited:

Xon

Well-known member
Hello,
i have huge forum with >3-5k online users at peak.
forum node list counters are slow. main page generates 7-9 secs.
after analysis i found a problem query and built an index.

You can add this to the next update.

result here:
View attachment 195434
Thanks, I'ld recommend using redis normally for that should that should help for the next release.


Thanks for your assistance, Xon!

So first I installed Redis Cache 4.2.0 on the webserver (but not my db server).
I just took a look at my config.php file and it contains the following:
Code:
$config['cache']['sessions'] = true;

$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Memcached';
$config['cache']['config'] = [
    'server' => '127.0.0.1'
];

Should I overwrite the memcached code with the Redis code that you provided, or add it above/below the Memcached section in case the LiteSpeed addon makes use of it?

I am just concerned with the possibility of either creating a conflict, or eliminating a necessary function. Like I said, I am pretty ignorant about that stuff.
Yes, you'ld need to replace the the memcache section, but the LiteSpeed addon should just work with the different cache backend.
 

xmlxp

Active member
Great addon. please include Count viewers for pages

I have APCu cache installed, do I still need to install Redis?
 

Xon

Well-known member
I really don't recommend using APCu cache, but this add-on will use MySQL backend if redis isn't available.
 

xmlxp

Active member
I uninstalled APCu then installed Redis daemon and Redis php extension. my questions is:
1. If I modify XF config.php file to connect Redis Do I still need to install Redis Cache add-on?
2. what are the best Redis configurations values to use in config.php file to run XF faster and to make the best of usage for User Activity add-on?
 

Xon

Well-known member
I uninstalled APCu then installed Redis daemon and Redis php extension. my questions is:
1. If I modify XF config.php file to connect Redis Do I still need to install Redis Cache add-on?
Yes.

2. what are the best Redis configurations values to use in config.php file to run XF faster and to make the best of usage for User Activity add-on?
Defaults are fine, biggest thing is to disable how often Redis persists to disk as this incurs a latency hit.
 

Xon

Well-known member
if you've set it up in config.php it'll error if something goes wrong, otherwise when Redis Cache add-on is installed it will report various redis stats on the admincp home page
 

dethfire

Well-known member
Will this use memcached too or only Redis?

I was looking over this update and I'm still confused if it's possible to display the user activity block in the sidebar?

Would be nice to have an option to disable tracking for guests too.

Got this error
Code:
    InvalidArgumentException: Accessed unknown getter 'content_type' on XF:Thread[960043] src/XF/Mvc/Entity/Entity.php:194

    Generated by: xxx Mar 10, 2019 at 1:49 PM

Stack trace

#0 src/XF/Mvc/Entity/Entity.php(106): XF\Mvc\Entity\Entity->get('content_type')
#1 src/addons/SV/UserActivity/XF/Pub/Controller/Thread.php(39): XF\Mvc\Entity\Entity->offsetGet('content_type')
#2 src/addons/SV/UserActivity/UserCountActivityInjector.php(56): SV\UserActivity\XF\Pub\Controller\Thread->similarThreadFetcher(Object(XF\Mvc\Reply\View), 'index', Array)
#3 src/addons/SV/UserActivity/UserCountActivityInjector.php(23): SV\UserActivity\XF\Pub\Controller\Thread->_injectUserCountIntoResponse(Object(XF\Mvc\Reply\View), 'Index')
#4 src/XF/Mvc/Controller.php(284): SV\UserActivity\XF\Pub\Controller\Thread->postDispatchType('Index', Object(XF\Mvc\ParameterBag), Object(XF\Mvc\Reply\View))
#5 src/addons/SV/UserActivity/UserActivityInjector.php(69): XF\Mvc\Controller->postDispatch('Index', Object(XF\Mvc\ParameterBag), Object(XF\Mvc\Reply\View))
#6 src/XF/Mvc/Dispatcher.php(343): SV\UserActivity\XF\Pub\Controller\Thread->postDispatch('Index', Object(XF\Mvc\ParameterBag), Object(XF\Mvc\Reply\View))
#7 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XF:Thread', 'Index', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#8 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#9 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#10 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#11 src/XF.php(390): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}

Request state

array(4) {
  ["url"] => string(34) "xxx/index.php?threads/964966/"
  ["referrer"] => string(50) "xxx/index.php?forums/155/"
  ["_GET"] => array(1) {
    ["threads/964966/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
Last edited:

dethfire

Well-known member
Could sidebar caching cause issues when doing thread list tracking? I have new threads widget with 3 people looking at a thread. It shows this in the widget. I also have forum category tracking. It lists no one in any category. So one of them is wrong and I suspect it's because the sidebar is cached?
 

Xon

Well-known member
Will this use memcached too or only Redis?
Either MySQL or Redis are supported backends.

I was looking over this update and I'm still confused if it's possible to display the user activity block in the sidebar?
This add-on doesn't use the widget system so you can't add it to the side bar.

Would be nice to have an option to disable tracking for guests too.
Easy to add.

Got this error
Code:
    InvalidArgumentException: Accessed unknown getter 'content_type' on XF:Thread[960043] src/XF/Mvc/Entity/Entity.php:194

    Generated by: xxx Mar 10, 2019 at 1:49 PM

Stack trace

#0 src/XF/Mvc/Entity/Entity.php(106): XF\Mvc\Entity\Entity->get('content_type')
#1 src/addons/SV/UserActivity/XF/Pub/Controller/Thread.php(39): XF\Mvc\Entity\Entity->offsetGet('content_type')
#2 src/addons/SV/UserActivity/UserCountActivityInjector.php(56): SV\UserActivity\XF\Pub\Controller\Thread->similarThreadFetcher(Object(XF\Mvc\Reply\View), 'index', Array)
#3 src/addons/SV/UserActivity/UserCountActivityInjector.php(23): SV\UserActivity\XF\Pub\Controller\Thread->_injectUserCountIntoResponse(Object(XF\Mvc\Reply\View), 'Index')
#4 src/XF/Mvc/Controller.php(284): SV\UserActivity\XF\Pub\Controller\Thread->postDispatchType('Index', Object(XF\Mvc\ParameterBag), Object(XF\Mvc\Reply\View))
#5 src/addons/SV/UserActivity/UserActivityInjector.php(69): XF\Mvc\Controller->postDispatch('Index', Object(XF\Mvc\ParameterBag), Object(XF\Mvc\Reply\View))
#6 src/XF/Mvc/Dispatcher.php(343): SV\UserActivity\XF\Pub\Controller\Thread->postDispatch('Index', Object(XF\Mvc\ParameterBag), Object(XF\Mvc\Reply\View))
#7 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XF:Thread', 'Index', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#8 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#9 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#10 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#11 src/XF.php(390): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}

Request state

array(4) {
  ["url"] => string(34) "xxx/index.php?threads/964966/"
  ["referrer"] => string(50) "xxx/index.php?forums/155/"
  ["_GET"] => array(1) {
    ["threads/964966/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
Will look into that
 

Xon

Well-known member
Got this error
Code:
    InvalidArgumentException: Accessed unknown getter 'content_type' on XF:Thread[960043] src/XF/Mvc/Entity/Entity.php:194

    Generated by: xxx Mar 10, 2019 at 1:49 PM

Stack trace

#0 src/XF/Mvc/Entity/Entity.php(106): XF\Mvc\Entity\Entity->get('content_type')
#1 src/addons/SV/UserActivity/XF/Pub/Controller/Thread.php(39): XF\Mvc\Entity\Entity->offsetGet('content_type')
#2 src/addons/SV/UserActivity/UserCountActivityInjector.php(56): SV\UserActivity\XF\Pub\Controller\Thread->similarThreadFetcher(Object(XF\Mvc\Reply\View), 'index', Array)
#3 src/addons/SV/UserActivity/UserCountActivityInjector.php(23): SV\UserActivity\XF\Pub\Controller\Thread->_injectUserCountIntoResponse(Object(XF\Mvc\Reply\View), 'Index')
#4 src/XF/Mvc/Controller.php(284): SV\UserActivity\XF\Pub\Controller\Thread->postDispatchType('Index', Object(XF\Mvc\ParameterBag), Object(XF\Mvc\Reply\View))
#5 src/addons/SV/UserActivity/UserActivityInjector.php(69): XF\Mvc\Controller->postDispatch('Index', Object(XF\Mvc\ParameterBag), Object(XF\Mvc\Reply\View))
#6 src/XF/Mvc/Dispatcher.php(343): SV\UserActivity\XF\Pub\Controller\Thread->postDispatch('Index', Object(XF\Mvc\ParameterBag), Object(XF\Mvc\Reply\View))
#7 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XF:Thread', 'Index', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#8 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Thread), NULL)
#9 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#10 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#11 src/XF.php(390): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}

Request state

array(4) {
  ["url"] => string(34) "xxx/index.php?threads/964966/"
  ["referrer"] => string(50) "xxx/index.php?forums/155/"
  ["_GET"] => array(1) {
    ["threads/964966/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
This is actually fixed in the v2.4.0+ with proper ElasticSearch Essentials similar thread support
 
Top