Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
in Q2A Core by
My site contains more than 450,000 questions
When asking a new question takes a lot of time is it because the database is large and is there a solution to speed up asking the questions
Q2A version: 1.8
I don't think it is related to a "large database" but rather to some plugin, theme customization or core hack that is slowing it down. Not to mention hosting, of course
I noticed that this plugin very slows down the site in versions q2a 1.8. After the removal of this plugin, the site normally fast openend.
The issue with that plugin was already reported. This happened in Q2A version 1.7 for me. The exact reason was an image creation function call causing memory leak.

3 Answers

+1 vote
I had this problem the solution is more RAM. or talk to your users and start over.
That's right. Is there a particularly slow query in that?
Of course, it must be a log when asking a question.
It is a log of the question page after redirection. Comment out redirect process below. As a result, question page will not be shown after asking question.

qa-include/pages/ask.php (around L171)
qa_redirect(qa_q_request($questionid, $in['title'])); // our work is done here
//qa_redirect(qa_q_request($questionid, $in['title'])); // our work is done here
+1 vote

To islam afify

Since other users will trouble by email, let's discuss in the new (this) answer section.

OK. There is no problem as long as that record count. It may be caused by MySQL setting. Above tool may be useful. When searching qa_posts table, MySQL may be running out of memory.
Thank you for your help
I've tired you a lot
I wish for good luck.
You have deleted the qa_posts table
The question is quickly asked. I think the problem is the number of big questions
+2 votes

The cache update queries are slow because the indexes are not properly tuned. This has already been discussed and I have explained it here.

Create the following indexes:

CREATE INDEX `test_index_1` ON `qa_posts`(`type`, `acount`, `closedbyid`);
CREATE INDEX `test_index_2` ON `qa_posts`(`type`, `selchildid`, `closedbyid`);
CREATE INDEX `test_index_3` ON `qa_posts`(`type`, `amaxvote`, `closedbyid`);

Try again and report back the results. Currently:

cache_unaqcount: 2347.10 ms
cache_unselqcount: 2699.90 ms
cache_unupaqcount: 2103.15 ms

If you are a purist and don't want those changes you can remove them with:

DROP INDEX `test_index_1` ON `qa_posts`;
DROP INDEX `test_index_2` ON `qa_posts`;
DROP INDEX `test_index_3` ON `qa_posts`;

edited by
Main points of your reports:

Variables to adjust:
    query_cache_size (=0)
    query_cache_type (=0)
    query_cache_limit (> 1M, or use smaller result sets)
    thread_cache_size (start at 4)
    performance_schema = ON enable PFS
    innodb_buffer_pool_size (>= 1G) if possible.
    innodb_log_file_size should be (=16M) if possible, so InnoDB total log files size equals to 25% of buffer pool size.
    innodb_buffer_pool_instances (=1)

What is "innodb_buffer_pool_size" setting of your MySQL? If it is the default 128 MB, it must allocate 1 GB or more.
I did all the recommendations but nothing changed
Have you restarted MySQL server?
Yes, I also used MySQLTuner again and there are no recommendations