Closed (fixed)
Project:
Mobile Tools
Version:
6.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Dec 2010 at 23:23 UTC
Updated:
31 Oct 2012 at 14:31 UTC
So I couldn't figure out why a site of mine started dragging so much...
Stats WITHOUT mobile_tools installed (ab -n 100 -c 10):
Concurrency Level: 10
Time taken for tests: 2.507 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1675000 bytes
HTML transferred: 1638200 bytes
Requests per second: 39.88 [#/sec] (mean)
Time per request: 250.730 [ms] (mean)
Time per request: 25.073 [ms] (mean, across all concurrent requests)
Transfer rate: 652.39 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 59 60 0.4 60 62
Processing: 185 189 3.9 188 206
Waiting: 65 69 3.8 68 86
Total: 244 249 4.0 248 266
Percentage of the requests served within a certain time (ms)
50% 248
66% 249
75% 250
80% 251
90% 253
95% 259
98% 264
99% 266
100% 266 (longest request) And stats WITH mobile_tools installed (ab -n 100 -c 10):
Concurrency Level: 10
Time taken for tests: 10.215 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1689500 bytes
HTML transferred: 1638200 bytes
Requests per second: 9.79 [#/sec] (mean)
Time per request: 1021.511 [ms] (mean)
Time per request: 102.151 [ms] (mean, across all concurrent requests)
Transfer rate: 161.52 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 60 60 0.6 60 64
Processing: 652 926 245.4 875 1978
Waiting: 531 805 245.3 754 1856
Total: 712 986 245.6 934 2038
Percentage of the requests served within a certain time (ms)
50% 934
66% 1066
75% 1084
80% 1096
90% 1198
95% 1587
98% 2036
99% 2038
100% 2038 (longest request) All I was using was mobile_tools built in browser detection. No redirection only theme switching.
Comments
Comment #1
twom commentedhmm.... something must go wrong...
This is the same issue as with #1001406: Apache and mysql getting overloaded when Mobile Tools is enabled... And I had a client who noticed a slow down too...
I'll look into that issue.
Some additional questions about your setup:
- are you using wurfl or browscap?
- are you using caching (so do you get cached pages with the tests)
If you have more clues, let me know then I can get a debugging head start.
Comment #2
mrP commented...sorry for duplication.
@twom:
No, I was using the mobile_tools built in browser/device detection
Yes. A lot in fact. However, the caching regime was not changed between the two tests. I ran the benchmark a couple of times to make sure it wasn't uncached php/css/js causing the results. In a nutshell, my caching setup is server site compression (via nginx) with core drupal css compression and js optimization enabled.
If its of any help, I was testing it with the iWebkit theme (http://drupal.org/project/iwebkit) though it seems like a more fundamental issue than a specific theme.
I've got a number of use cases for mobile_tools so if there is anything I can do to help don't hesitate to ask.
Comment #3
twom commentedHi,
I have not been able to track the problem completely. But there is something wrong with using hook_boot for theme switching and redirection.
I have submitted new code to the dev version where the theme switching happens in the hook_init (where it makes sense).
In case you don't need redirection, you can comment out the hook_boot code, and move $mobile_tools_device = mobile_tools_get_device(); to the top of the hook_init() module. Probably you won't have performance problems anymore...
Needs to be researched more.
Comment #4
mrP commentedI tried the 2.x-dev version with no change in mean response time. If there is more that I can test let me know.
Comment #5
mrP commentedThere hasn't been any development on this issue in nearly a year. This has been a critical deterrent to the adoption of mobile_tools.
I'd throw in a fair bounty to get this fixed asap.
Comment #6
minoroffense commentedWe're reworking the theme switching to use ThemeKey in the 3.x branch of Mobile Tools. In the mean time, you can try using ThemeKey for Drupal 6 to handle the change and use Mobile Tools for the URL handling/device detection.
Unfortunately, since we'll be dropping the 2.x branch for the 3.x with a whole new architecture, I don't see this getting fixed very soon if at all.
If someone does come across a fix, please feel free to post it for review.
Thanks,
Comment #7
devin carlson commentedMarked #1483944: Very slow redirect to .m domain as a duplicate.
Comment #8
devin carlson commentedRelated #1632470: Add static caching to commonly called functions.
Comment #9
devin carlson commentedThe addition of static caching to the existing mobile tools hooks should improve performance a bit. You should also try minorOffense's suggestion in #6.