Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening the project links from the user profile page takes too long #207

Closed
GoogleCodeExporter opened this issue Mar 13, 2015 · 10 comments
Closed

Comments

@GoogleCodeExporter
Copy link
Collaborator

Called by NarroUserDataGridGen->MetaDataBinder(NULL) Hide   
File: 
/var/www/narro/narro/includes/qcubed/includes/qcubed/_core/base_controls/QFormBa
se.class.php;   Line: 337

SELECT
    `t0`.`user_id` AS `a0`,
    `t0`.`username` AS `a1`,
    `t0`.`password` AS `a2`,
    `t0`.`email` AS `a3`,
    `t0`.`data` AS `a4`,
    SUM(`t1`.`suggestion_word_count`) AS `__translation_word_count`
FROM
    `narro_user` AS `t0`
    LEFT JOIN `narro_suggestion` AS `t1` ON `t0`.`user_id` = `t1`.`user_id`
    LEFT JOIN `narro_text` AS `t2` ON `t1`.`text_id` = `t2`.`text_id`
    LEFT JOIN `narro_context` AS `t3` ON `t2`.`text_id` = `t3`.`text_id`
WHERE
    (
    (
    `t3`.`project_id` = 28
    AND
    `t1`.`language_id` = 120
    AND
    `t0`.`user_id` != 0
    )
    AND
    1=1
    )
GROUP BY
    `t0`.`user_id`
ORDER BY
    __translation_word_count DESC

Query took 4076.0 ms

Called by NarroUserDataGridGen->MetaDataBinder(NULL) Hide   
File: 
/var/www/narro/narro/includes/qcubed/includes/qcubed/_core/base_controls/QFormBa
se.class.php;   Line: 337

SELECT
    `t0`.`user_id` AS `a0`,
    `t0`.`username` AS `a1`,
    `t0`.`password` AS `a2`,
    `t0`.`email` AS `a3`,
    `t0`.`data` AS `a4`,
    COUNT(`t1`.`context_info_id`) AS `__translations_reviewed`
FROM
    `narro_user` AS `t0`
    LEFT JOIN `narro_context_info` AS `t1` ON `t0`.`user_id` = `t1`.`validator_user_id`
    LEFT JOIN `narro_context` AS `t2` ON `t1`.`context_id` = `t2`.`context_id`
WHERE
    (
    (
    `t2`.`project_id` = 28
    AND
    `t1`.`language_id` = 120
    AND
    `t0`.`user_id` != 0
    )
    AND
    1=1
    )
GROUP BY
    `t1`.`validator_user_id`
ORDER BY
    __translations_reviewed DESC

Query took 1100.5 ms

Full Report:
http://paste.ubuntu.com/699364/
http://paste.ubuntu.com/699387/

Original issue reported on code.google.com by hitmana...@gmail.com on 29 Sep 2011 at 11:36

@GoogleCodeExporter
Copy link
Collaborator Author

Original comment by alex...@gmail.com on 30 Sep 2011 at 8:15

  • Changed state: Accepted
  • Added labels: Priority-High
  • Removed labels: Priority-Low

@GoogleCodeExporter
Copy link
Collaborator Author

Tests done using the full lmo database dump. 


Original comment by hitmana...@gmail.com on 30 Sep 2011 at 11:27

@GoogleCodeExporter
Copy link
Collaborator Author

Steps to Reproduce this problem. 

1. Go to user profile (eg https://l10n.mozilla.org/narro/user.php?l=en-US&u=494)
2. Select and open links in 'Projects' column into multiple tabs (5 or more 
links)
3. The mysql server start to experience load 


Snapshot from local machine: Requested mysql stats from lmo.
   Id      User         Host/IP         DB      Time    Cmd Query or State                                                                           
        --      ----         -------         --      ----    --- --------------                                                                           
        54      root       localhost      narro         0  Query show full processlist                                                                    
        59     narro       localhost      narro       503  Sleep                                                                                          
        60     narro       localhost      narro       503  Query SELECT COUNT(*) AS q_row_count FROM `narro_context_info` AS `t0` LEFT JOIN `narro_context



Original comment by hitmana...@gmail.com on 1 Oct 2011 at 12:15

@GoogleCodeExporter
Copy link
Collaborator Author

Fixed in revision 33d1d78a7205 

Original comment by alex...@gmail.com on 1 Oct 2011 at 2:39

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Collaborator Author

And revision cca616aa0605 

Original comment by alex...@gmail.com on 1 Oct 2011 at 2:43

@GoogleCodeExporter
Copy link
Collaborator Author

Looking back on this, I see the issue started with some queries from the 
project overview page, but the reproducing steps state something else. I 
already fixed the project overview page, so I'll continue with the other 
problem which I can reproduce on lmo. 

Original comment by alex...@gmail.com on 1 Oct 2011 at 6:06

  • Changed title: Opening the project links from the user profile page takes too long
  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Collaborator Author

I've made several improvements in revision 0ce8705eb72d and revision 
9ead67abae6f but the problems is still present on lmo. Not present on my other 
installations: http://tradu.softwareliber.ro/user.php?l=ro&u=1 .

Seems like opening several requests in parallel from the same browser locks the 
server for several minutes.

I'll try reproducing this locally with the same database.

Original comment by alex...@gmail.com on 2 Oct 2011 at 7:25

@GoogleCodeExporter
Copy link
Collaborator Author

Thank you for your fixes. The tradu.softwareliber.ro is really fast and snappy. 

Original comment by hitmana...@gmail.com on 2 Oct 2011 at 7:39

@GoogleCodeExporter
Copy link
Collaborator Author

Original comment by alex...@gmail.com on 12 Oct 2011 at 6:00

  • Added labels: Version-2, Complexity-Medium, Page-UserProfile

@GoogleCodeExporter
Copy link
Collaborator Author

Loading times are 2 to 8 seconds on l10n.m.o.
Please reopen if you see values above this.

Original comment by alex...@gmail.com on 18 Oct 2011 at 7:44

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant