Yii Framework Forum: Yiibooster Seems Slow - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yiibooster Seems Slow Yiibooster Seems Slow Rate Topic: ***** 2 Votes

#1 User is offline   Zibnimer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 12-November 12

Posted 17 November 2012 - 06:11 PM

When I added Yiibooster library to my website, it seems to slow page loading. When I remove the Yiibooster files, it becomes fast again.

It is slow without using any Yiibooster components. when I click on 'Home', 'About, or 'Contact us' link, the page gets blanked "white" and loads after 2 seconds.

www.jrowser.com, my test site. This is on a dedicated server.

Any ideas?

Thx
0

#2 User is offline   glazedates 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 26-November 12

Posted 27 November 2012 - 10:45 AM

I also have this problem. :(

Since all bootstrap files are preloaded, I tried to remove some files that I don't think I will be using, especially the folder bootstrap/assets/js/ckeditor, which is more than 3MB. I'm not sure if this is good or if it won't cause problems in the future, but it helped the page loading speed.
0

#3 User is offline   bit0123 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 75
  • Joined: 01-February 12
  • Location:Bangladesh

Posted 27 November 2012 - 11:09 AM

View PostZibnimer, on 17 November 2012 - 06:11 PM, said:

When I added Yiibooster library to my website, it seems to slow page loading. When I remove the Yiibooster files, it becomes fast again.

It is slow without using any Yiibooster components. when I click on 'Home', 'About, or 'Contact us' link, the page gets blanked "white" and loads after 2 seconds.

www.jrowser.com, my test site. This is on a dedicated server.

Any ideas?

Thx


Please, check the following function on the bootstrap/components/Bootstrap component:
public function getAssetsUrl()
        {
                if (isset($this->_assetsUrl))
                        return $this->_assetsUrl;
                else
                {
                        $assetsPath = Yii::getPathOfAlias('bootstrap.assets');
                        $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG); // <----- Your YII_DEBUG is telling whether to forceCopy or not
                        return $this->_assetsUrl = $assetsUrl;
                }
        }

Replace YII_DEBUG by false
See the result.
Hopefully it will work.
3

#4 User is offline   glazedates 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 26-November 12

Posted 27 November 2012 - 11:24 AM

View Postbit0123, on 27 November 2012 - 11:09 AM, said:

Please, check the following function on the bootstrap/components/Bootstrap component:
public function getAssetsUrl()
        {
                if (isset($this->_assetsUrl))
                        return $this->_assetsUrl;
                else
                {
                        $assetsPath = Yii::getPathOfAlias('bootstrap.assets');
                        $assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, YII_DEBUG); // <----- Your YII_DEBUG is telling whether to forceCopy or not
                        return $this->_assetsUrl = $assetsUrl;
                }
        }

Replace YII_DEBUG by false
See the result.
Hopefully it will work.


It does! Thank you. :)
0

#5 User is offline   bit0123 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 75
  • Joined: 01-February 12
  • Location:Bangladesh

Posted 27 November 2012 - 12:21 PM

View Postglazedates, on 27 November 2012 - 11:24 AM, said:

It does! Thank you. :)


Welcome!!!
0

#6 User is offline   rclai89 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 01-December 12

Posted 13 December 2012 - 03:33 PM

Wow, this does work. My page went from like 6 seconds to like.. less than a second.

Is there a particular reason why this works?

Edit:

Ahh there was a comment on the extension page, saying:

Hello, new releases republish assets if you are in DEBUG mode, If you set Yii to production mode it will solve timming problem

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
Other thing you can do: edit Bootstrap component and in line 458:

$assetsUrl = Yii::app()->assetManager->publish($assetsPath, false, -1, false);
is what i do in every bootsrap update to my file, theres no need to wait in debug mode
0

#7 User is offline   Whit 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 24-November 12
  • Location:WI USA

Posted 13 December 2012 - 07:41 PM

This problem was driving me nuts. Thanks for the help!

Cheers, Whit
0

#8 User is offline   SaulBW 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 17-October 12
  • Location:Cape Town, South Africa

Posted 28 December 2012 - 05:43 PM

Can't tell you how many times I've had to open up my entry script and toggle debugging to avoid the loads :lol:

Thanks for the quick fix.
0

#9 User is offline   ramasurf 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 06-February 12

Posted 15 January 2013 - 09:49 AM

@bit0123 thank you man
It should be published in the booster's webpage

bye!
0

#10 User is offline   salem 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 25-August 12
  • Location:Tunisia

Posted 24 January 2013 - 09:28 AM

i realized a test on a fresh generated app on my localhost using the apache ab tool, sending 1000 requests, five at a time to the contact page :

ab -n 1000 -c 5 http//localhost/myProject/index.php?r=site/contact


the results where:

  • when using default Chris's bootsrtap -> the website can process 20.07 requests per second.
  • when using the default booster -> the website can process 1.41 requests per second.
  • when using booster after replacing YII_DEBUG by false on bootstrap/components/Bootstrap (line 458) -> the website can process 21.89 requests per second. wish is almost the same as the first test.


i think that @bit0123 solution is a must do when we are in production. the gain in speed is more than 15 times.
1

#11 User is offline   Franker 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 02-January 13

Posted 24 January 2013 - 10:25 AM

View Postsalem, on 24 January 2013 - 09:28 AM, said:

i realized a test on a fresh generated app on my localhost using the apache ab tool, sending 1000 requests, five at a time to the contact page :

ab -n 1000 -c 5 http//localhost/myProject/index.php?r=site/contact


the results where:

  • when using default Chris's bootsrtap -> the website can process 20.07 requests per second.
  • when using the default booster -> the website can process 1.41 requests per second.
  • when using booster after replacing YII_DEBUG by false on bootstrap/components/Bootstrap (line 458) -> the website can process 21.89 requests per second. wish is almost the same as the first test.


i think that @bit0123 solution is a must do when we are in production. the gain in speed is more than 15 times.


But i have still the feeling that Yiibooster is too slow. Compare to a fresh generated site the difference is pretty big. :-(
1

#12 User is offline   salem 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 25-August 12
  • Location:Tunisia

Posted 25 January 2013 - 04:27 PM

View PostFranker, on 24 January 2013 - 10:25 AM, said:

But i have still the feeling that Yiibooster is too slow. Compare to a fresh generated site the difference is pretty big. :-(


exactly 24.46 requests per second is what the same app that i'm testing can process in my localhost when using yii's default theme with the blueprint css framework.

i suppose that things will be different when a project become more complex and after use of more booster components. maybe we got to test that later & compare with other css themes or frameworks. but for now. the beauty of my fresh app thanks to booster & twitter's bootstrap is worth
0

#13 User is offline   Wildan Muhlis 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 27-February 13

Posted 27 March 2013 - 04:20 AM

View PostZibnimer, on 17 November 2012 - 06:11 PM, said:

When I added Yiibooster library to my website, it seems to slow page loading. When I remove the Yiibooster files, it becomes fast again.

It is slow without using any Yiibooster components. when I click on 'Home', 'About, or 'Contact us' link, the page gets blanked "white" and loads after 2 seconds.

www.jrowser.com, my test site. This is on a dedicated server.

Any ideas?

Thx



Consider to take some research from yiiboilerplate master project, YiiBooster was included, maybe there are some miscunfiguration on your project.
0

#14 User is offline   salsero 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 05-September 12
  • Location:Italia

Posted 19 April 2013 - 10:58 AM

View Postbit0123, on 27 November 2012 - 11:09 AM, said:

Please, check the following function on the bootstrap/components/Bootstrap component:

Replace YII_DEBUG by false


thank's!!! after a day i'm going crazy this is the solution!!! ;) thank's!!!!
0

#15 User is offline   lukBB 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 45
  • Joined: 08-December 10

Posted 27 November 2013 - 04:15 AM

+ 1 for the simple solution :) it works just perfect
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users