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

twom’s picture

hmm.... 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.

mrP’s picture

...sorry for duplication.

@twom:

Some additional questions about your setup:
- are you using wurfl or browscap?

No, I was using the mobile_tools built in browser/device detection

- are you using caching (so do you get cached pages with the tests)

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.

twom’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Hi,

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.

mrP’s picture

I tried the 2.x-dev version with no change in mean response time. If there is more that I can test let me know.

mrP’s picture

Component: Miscellaneous » Code
Priority: Normal » Critical

There 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.

minoroffense’s picture

Status: Active » Postponed

We'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,

devin carlson’s picture

devin carlson’s picture

Title: Mobile Tools QUADRUPLES mean response time » Improve Mobile Tools performance
Category: bug » task
Priority: Critical » Major
Status: Postponed » Active
devin carlson’s picture

Status: Active » Fixed

The addition of static caching to the existing mobile tools hooks should improve performance a bit. You should also try minorOffense's suggestion in #6.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.