Hi all,

For a 'language testing site' in the Netherlands i started to use drupal with the quiz module instead of the Joomla environment where it used to be built in. We decided to already use quiz 4 for it, which maybe is a little bit too early?

We let visitors login anonymously (by filling out a form, inclucing capcha image), so we can track their results for research purposes.

Every day about 500+ test are done by our visitors. The system works too slow at the moment, so i'm busy looking for solutions. The apache server is being optimized atm. Our next step is to take a deeper look at the drupal (quiz) processes.

Should i start using quiz 3 to be able to let it work smoothly for this amouth of visitors a day? Are there any specific areas the problem might be located?

Any help is welcome, as well as i'm willing to help the developers in providing relevant testing information.

You can visit the site at: http://www.nederlandsetaaltest.nl

Best regards,

Rogier

Comments

falcon’s picture

Version: 6.x-4.0-alpha4 » 6.x-4.x-dev

Yes, it is a little bit to early to be using quiz 4 on a production site.

I don't know if quiz 3 scale better, or have better performance. I have little or no experience with Quiz 3. I do know that in Quiz 3 multichoice is a regular drupal module, and has been tested for a while. In quiz 4 multichoice has been rewritten to use the quiz OO framework(quiz_question). I strongly suspect that the OO framework causes some extra database load. In addition the Quiz 4 module haven't been performance tested yet.

If you try quiz 3 or profile quiz 4 I hope you'll find the time to post your findings here.

falcon’s picture

To be clear: We haven't done anything to map or improve performance in quiz 4 yet. We will work on performance in the beta releases. I don't think we'll have the time to make it perform super fast, but we will make it perform good enough to be "usable" when we reach RC.

mbutcher’s picture

Rogier,

If it is SQL related, then it should be easy to debug:

* Install an enable the Devel module
* Turn on the SQL Query Logging

It will show the time for each query, marking particularly slow ones in red.

You may also want to look at using Page Cache (with the Cache Exclude module to exclude quizzes) to optimize other parts of the site to operate quickly. Relieving load elsewhere would help Quiz perform better. And an opcode cache on Apache would help, too.

rodgey’s picture

I probably move to quiz 3 than as soon as I will post the new tests on the site...

Though we will start a logging proces for the server aswell as the drupal (including) installation anyway. If there is any specific data which is helpful for the developers, i´ll be happy to look it up and report it here.

I'm working with a developer at a project now for the near future aswell, which is planned to be tested in a real educational environment in the first months next year. We integrated quiz 4 in it aswell.

I'll defenately take some time to share my findings here. I guess i might be able to come up with some relevant issues to fix which helps the project to be stable sooner.

rodgey’s picture

Thanks, that's what i just hired someone for, so i quess the future looks bright ;)

rodgey’s picture

If you need someone for testing, don't hesitate to ask

edit: I'm new here by the way... thought those replies would be right underneath the post..

sivaji_ganesh_jojodae’s picture

I followed mbutcher's suggestion #3 on a testing site with quiz 4.x. Created a quiz with 7 questions. As i proceed along the quiz as registered user the SQL load is as follow

Page execution time was 352.95 ms. Executed 48 queries in 42.47 milliseconds.
Memory usage:
Memory used at: devel_init()=0.92 MB, devel_shutdown()=9.76 MB.

Page execution time was 401.11 ms. Executed 51 queries in 36.11 milliseconds.
Memory usage:
Memory used at: devel_init()=0.92 MB, devel_shutdown()=9.88 MB.

Page execution time was 308.68 ms. Executed 45 queries in 27.95 milliseconds.
Memory usage:
Memory used at: devel_init()=0.92 MB, devel_shutdown()=9.73 MB.

Page execution time was 385.98 ms. Executed 46 queries in 57.42 milliseconds.
Memory usage:
Memory used at: devel_init()=0.92 MB, devel_shutdown()=9.77 MB.

// This is for feedback page that appears at the end of the quiz
Page execution time was 13750.48 ms. Executed 127 queries in 13059.28 milliseconds.
Memory usage:
Memory used at: devel_init()=0.92 MB, devel_shutdown()=10.35 MB.

Server configuration
CentOS 4.7 (512 MB RAM and AMD Opteron Quad core processor)
PHP 5.2.11
MySQL 5.0.85
Drupal 6.14 (page compression, block cache, CSS and JS aggregator enabled)

This SQL load seems to be normal for me (except for feedback page).

falcon’s picture

Category: support » task
Status: Active » Needs work

We are starting to work on these types of issues now.

It will still take some time before we reach this one, but the performance issues will be addressed before we release our release candidate.

falcon’s picture

We have done some improvements now. Would you be able to run a test of the latest dev release locally and post any slow queries here?

The quiz result page is still running an extreme amount of queries, but we're not going to fix this in 4.0. We have improved the performance of the result page a lot already, but it can still be a lot faster in my opinion. It will require a major rewrite though, and will result in a lot of issues.

In an upcoming release we will try to fetch all the data we need to generate that page from only one query. The alternative is to cache reports for each question, but I don't think that would be a good idea.

On the result reports this has been improved
- Before performance optimization begun each question node was loaded multiple times to provide its result report. This caused an enormous load on both php and mysql.
- Now none of the question nodes are loaded. This reduces mysql and php load by around 66 % on my local host.

On question taking this has been improved
- Before performance optimization begun the question node was loaded multiple times. It was loaded again and again for each function called from quiz_question.
- Now the question nodes are stored in static cache, resulting in a big performance improvement.

On the question browser this has been improved:
- Replaced inner join with outer join to avoid constructing cartesian products of all the table rows before LIMIT cuts away rows that aren't needed.
- Used LIMIT in the pagers count queries so that the count query won't have to join and process all rows. It only count enough rows to know whether or not it should show links to the next five pages. The link to the last page has been removed because we're not counting that far anymore
= This results in a major reduction on sql load if you have a lot of questions and results stored in your db. The performance gain increases by the amount of questions/results your search finds. (There are no performance gain if you are visiting the last pages of your result.)

falcon’s picture

Status: Needs work » Fixed

Now I've also added indexes where needed to optimize quiz taking performance.

I mark this one as fixed. If there still are problems please reopen this issue.

falcon’s picture

Status: Fixed » Closed (fixed)