Problem with large room archive

Adds a convenient search box at the top of mChat's archive page that allows you to search all messages
Post Reply
Bgagger
Donor
Posts: 63
Joined: 28 Nov 2018, 15:57

Problem with large room archive

#1

Post by Bgagger » 21 Feb 2020, 18:54

Hello again. Here I am with yet another problem.
It's not too critical, we can live with it for now, but in the long run I'll have to find some way to deal with it.

mChat and archives work well overall. But we have one room on our mchat installation that is especially big. Yeah it's kind of large.
So big in fact that the archive page crashes with a white screen of death critical PHP error when trying to open the archive page for that particular room, every time:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /home/*****/public_html/*****/forum/phpbb/db/driver/mysqli.php on line 257

With phpBB 3.3.0 and mChat 2.1.3

Is there some way to limit the amount of pages mchat archive loads at once? Or at all? let's say you want to put a limit so that the archive view stops loading pages after 1000 of the latest ones.

Otherwise we will probably have to raise the memory limit in PHP for the server. But I want to avoid doing that on a forum wide scale, as that could lead to all sorts of problems.
For now putting a ini_set("memory_limit","[X]M"); line in the

Code: Select all

- This code is only accessible to donors -
function of mchat.php seems to work. But we'd have to keep increasing the allowed memory limit as the archive grows.

User avatar
kasimi
mChat developer
Posts: 1056
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Problem with large room archive

#2

Post by kasimi » 21 Feb 2020, 20:17

I don't see a memory problem here:

memory_usage.png

mChat doesn't load more messages than you've specified in the ACP. For generating the pagination, phpBB only needs the total number of messages, it doesn't load the contents of all message.

What other mChat add-ons are enabled? Did you try disabling them? What database are you running?
You do not have the required permissions to view the files attached to this post.

Bgagger
Donor
Posts: 63
Joined: 28 Nov 2018, 15:57

Re: Problem with large room archive

#3

Post by Bgagger » 21 Feb 2020, 20:27

The boardware is running on:
Database server: MySQL(i) 5.7.29-cll-lve

Good call, I tried disabling the 'archive search' extension, which seems a reasonable culprit. And now it works!
It seems archive search is loading a lot of data.

User avatar
kasimi
mChat developer
Posts: 1056
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Problem with large room archive

#4

Post by kasimi » 21 Feb 2020, 21:18

Do you hit the memory limit when browsing the archive or when searching in the archive?

Moving this to the mChat Archive Search forum.

Bgagger
Donor
Posts: 63
Joined: 28 Nov 2018, 15:57

Re: Problem with large room archive

#5

Post by Bgagger » 21 Feb 2020, 21:25

kasimi wrote:
21 Feb 2020, 21:18
Do you hit the memory limit when browsing the archive or when searching in the archive?

Moving this to the mChat Archive Search forum.
Simply opening the page causes the crash. ie. after selecting a big room with the 'Select room:' dropdown.

Added in 3 minutes 9 seconds:
If it helps with perspective, the room in question has 281055 rows/posts in the db.

User avatar
kasimi
mChat developer
Posts: 1056
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Problem with large room archive

#6

Post by kasimi » 21 Feb 2020, 21:53

I still can't reproduce this on my end.

Add this code to your config/production/config.yml:

Code: Select all

- This code is only accessible to donors -
Now access the page that uses a lot of memory, click on the SQL Explain link in the footer of the page and send me a PM with a screenshot of the entire page. Don't forget to revert the changes in your config.yml.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest