Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Dmacleo Posted June 22, 2012 Posted June 22, 2012 if I understand right this: 36 queries - IPC right side bar hooks; - 20 queries - IPC articles is per user right? or is that total fo all user online? 36 sidebar hooks seems high.
Grumpy Posted June 23, 2012 Posted June 23, 2012 DAMMIT!!! I just wrote a ton and accidentally pressed back... now it's all gone. Now I'm going to write in point forms and key ones only. 1. The #83 by me was my mistake. I saw your attachment and it had 83 lines. But, it was double spaced. But, you found an 85 in your main page, so situation really doesn't change. 2. it is likely that your plugin is poor. I suggest you find the problematic one by trial. Disable one (or a set) and repeat until you find which one causes a significant slow down. Or cumulatively so. Just keep debug level to 1. And then you'll see the execution time to benchmark each results. Try every set at least 3 times to rule out anomalies. 3. According to your mysqltuner, you don't seem to have extremely terribly slow queries. 4. It may be coincidence and your vps just has a lot of other work to do at this time. Don't rule this out. 5. 50 users is a very small amount in my opinion. This frankly should run fine. 6. Oh and Invision Power is not stupid enough to write queries like this: SELECT blog_id FROM ibf_blog_blogs WHERE blog_authorized_users LIKE '%,2,%' That is definitely from a 3rd party source. @Dmacleo It would be per page load. If there are 85 queries per page. 50 people visits the website, each of which surfs 10 pages on average. Then, that would be 85*50*10= 42500 queries executed.
AlexJ Posted June 23, 2012 Posted June 23, 2012 @Dmacleo It would be per page load. If there are 85 queries per page. 50 people visits the website, each of which surfs 10 pages on average. Then, that would be 85*50*10= 42500 queries executed. For the front page yes it is.. My simple front page generates around 30-50 queries. If u add more blocks it's going to generate more. That's how IP.Content is designed. It's all depends how many blocks u got per page. I never understood why ajax based blocks are not used to avoid high queries amount.. but that's again another story.
donpetru Posted June 23, 2012 Author Posted June 23, 2012 6. Oh and Invision Power is not stupid enough to write queries like this: SELECT blog_id FROM ibf_blog_blogs WHERE blog_authorized_users LIKE '%,2,%' That is definitely from a 3rd party source. To correct bit, I said above - 36 queries - IPC right side bar hooks; but is not hooks, is IP Content blocks. Now, in these IP Content blocks I use the default template generates by IP Content where I added the avatar user, like this (last forum post block with 6 results):<div class='ipsBox'> <div class='ipsBox_container ipsPad'> <div class='general_box'> <h3>{$title}</h3> <ul class='hfeed'> <if test="is_array( $records ) && count( $records )"> {parse striping="feed_striping" classes="row1,row2 altrow"} <foreach loop="$records as $r"> <li class='hentry {parse striping="feed_striping"}'> <table> <tr> <td class="style2" valign="top" width="60px"> <center><img src='{$r['pp_mini_photo']}' width='{$r['pp_mini_width']}' height='{$r['pp_mini_height']}' class='photo' /></center> <!-- <span class='desc'> By --> <a href='{parse url="showuser={$r['member_id']}" base="public"}'><FONT SIZE="1" COLOR="#304b9c"><b><center>{$r['members_display_name_short']}</center></b></FONT></a> </td> <td class="style1" valign="top"> <a href='{$r['url']}' title='{$r['title']}'>{$r['title']}</a> <br /><span class='date'><abbr class="published" title="{parse expression="date( 'c', $r['date'] )"}">{parse date="$r['date']" format="short"}</abbr></span><br /> <!-- <span class='desctext'>{IPSText::truncate( strip_tags($r['content']), 32 )}</span> --> </td> </tr> </table> </li> </foreach> </if> </ul> </div></div></div> Basic instructions remained fixed those generated by IP Content plus "my code": <img src='{$r['pp_mini_photo']}' width='{$r['pp_mini_width']}' height='{$r['pp_mini_height']}' class='photo' /> Now, I also have a total of 8 blocks above on the right bar. Then, I tried to analyze how many queries need a block like the one above (Last Forum Posts). The result is: 9 queries. Why ? If I try to delete the code: <img src='{$r['pp_mini_photo']}' width='{$r['pp_mini_width']}' height='{$r['pp_mini_height']}' class='photo' />[/code] from the IPC block last forum posts, then the result is: 9 queries. Is the same. Now try to remove the date and time, then the result is: 9 queries. But if I try remove this code (is commented): [code]<!-- <span class='desctext'>{IPSText::truncate( strip_tags($r['content']), 32 )}</span> -->[/code] then the result is 9 queries (expected because it was a comment). Now, let's see that code generates 9 queries from the block above. I left last forum post block in this form: [code]<h3>{$title}</h3> <if test="is_array( $records ) && count( $records )"> {parse striping="feed_striping" classes="row1,row2 altrow"} <foreach loop="$records as $r"> </foreach> </if>[/code] and the result is.... 9 queries. Now comes the question is: who wrote these instructions as above? I or IPS? The answer is: "IPS". And why should I optimize my block? IPS should come up with a solution ...or not ? I repeated the above steps and IPC block Last Blogs. The result is only 4 queries. A summary of all results is the following for my home page website with IP Content: 1) [u]Side bar IP Content blocks[/u]: - last forum posts with 6 results - 9 queries - last blogs with 5 results - 4 queries - last files form IP Downloads with 5 results - 3 queries - last video files from my custom database ( with 5 results - 9 queries - gallery recent sidebar block with 3 photos - 4 queries - last news from my custom ipc database - 8 queries - last FAQ from my custom ipc database - 8 queries - th-todaybday - 4 queries 2) [u]Another IPC block from main page[/u]: - last articles block with 10 results / page - 21 queries - glceasytabs block - 7 queries - board_stats block - 1 queries - user's online - block="act32" - 3 queries 3) [u]Header and footer ipb web home page[/u] - 7 queries So, why need so many queries one IPC block ?IPContent Media System)
donpetru Posted June 23, 2012 Author Posted June 23, 2012 I talked to several people working as web developers and after they analyzing my Invision Power Board (one of them have one IPB forum), they told me that: the link between IPB applications (especially IP Content) and IPB core, especially when it is established IP Content application as home page, is "eating" a lot of queries. Or in other words, the link above requires some extra queries for each statement, sometimes too many queries. An example is the statement <if> and <foreeach> above which normally should not take more than two queries but because of link that I told you, this complicates things. Then, I asked what solution would be and they told me it would be reconsidered "link", that IPB software rewritten, so that a statement's <foreach> and <if> to be executed in the more than 2 queries. Then they say that the problem arose because the IPB was designed around the board with all its applications, not separately. I told them then about my solution from this topic: http://community.invisionpower.com/topic/356988-when-it-comes-ipb-40/page__st__20 (see post no.22) and they told me it's a good idea, an idea which removes many of these problems, like that with too many queries for a IPC block. Now I do not know if their recommendations are 100% correct but my humble experience, I'd say yes.
Dmacleo Posted June 23, 2012 Posted June 23, 2012 I may be wrong but I think the upcoming core suite changes may address a lot of that.
Grumpy Posted June 24, 2012 Posted June 24, 2012 Ugh... too much to read. lol I'm just going to accept the length as evidence and agree with you that IPB's auto-generated queries are sub-optimial. But, like I said above, 50 users, 83 queries... this isn't something far from what a vps should have no prob handling. It's not even a large load. You can try some mysql optimizations and maybe some additional caching by following the mysqtuner. Though... looking at your tuner output, there isn't much to tune. You can increase your tmp_table to something like 128M along with its heap (add them to my.cnf under [mysqld]). But, if you have a lot of content stuff, this won't really change your ratio. B/c IPC stuffs everything into text/blobs. Which is highly inefficient and can't go inside memory (kinda stupid restriction from mysql imo). Oh and do run "optimize", it's nice to run them often (like once a day/week). In the end, maybe your vps sucks. Some hosts even sell vps with 5.4k rpm drives. >.>
donpetru Posted June 24, 2012 Author Posted June 24, 2012 Indeed, I do not know if the alvotech.de VPS's are great, but I try to squeeze as much performance from the VPS. I do not like VPS's alvotech because use swap RAM as burst RAM. Returning to my site, if I don't have any user(visitors) online, then use RAM is less than 400Mb (with about 50 tasks). If the site connects 10 users and I have still about 25 visitors, the number of tasks increases (over 70) and RAM usage easy reach 1GB RAM, website difficult to access, even with all the forum that has with the header and footer only 9 queries. For each user visitor connected, virtual memory statistics show top command is about. 80MB. I tried unsuccessfully several optimization. It seems that apache and control panel ispCP Omega "eat" more RAM. For this reason I have to retry again and I use nginx. Then, I return to other conclusions. Thanks for reply all.
Dmacleo Posted June 24, 2012 Posted June 24, 2012 by any chance are most of the visitors crawlers that are eating resources?
donpetru Posted June 24, 2012 Author Posted June 24, 2012 I know the web crawlers are eating some resources but when I did the test was only one web crawler. Moreover, I repeated the test and when there don't was web crawler. So, the idea is that: increased so fast RAM use it for a few users and visitors is not a good thing. You realize what resources would eat if I have 200 users and guests online? Before, when I was on shared hosting with IPB 3.1.2, we reached 120 users and online visitors, with a raft of overload and now, on a VPS which cost twice more than shared hosting subscription, I can not to keep any of 50 users and visitors, is not good. Now, a VPS be to blame? is it the fault new ipb suite? I don't know. Can you tell me?
Dmacleo Posted June 24, 2012 Posted June 24, 2012 I honestly do not know, I don't see that load/issues with approx the same users. with all thats been posted, and with my own experiences (which are opinions only) I would looks towards the underlying server and OS. this is a LONG shot but perchance have you customized php.ibi and allowed a really long max execution time and max_input time? is this maybe debian squeeze issue? I am on centos 6.2 and don't see this.
donpetru Posted June 24, 2012 Author Posted June 24, 2012 You have Cent OS 32 bit or 64 bit ? By the way, which Linux version uses the least CPU and RAM ?
Dmacleo Posted June 24, 2012 Posted June 24, 2012 64 bit, no sense using 32. as far as what uses the least I do not know, perhaps a better question is what one does best as a server.. I've tried ubuntu and centos, cent worked better for me.
donpetru Posted June 24, 2012 Author Posted June 24, 2012 When you say much better, what do you mean, take up less CPU and RAM the OS or.. ?
Dmacleo Posted June 24, 2012 Posted June 24, 2012 was few months back so my memory is a little fuzzy but average ram usage was lower, cpu seemed to be about the same, apache seemed to respond faster but I don't have any figures to back that up. for some reason and I never looked into it, mysql seemed to run better on centos. I have not tried a lot of distros though, centos has always worked for me.
Grumpy Posted June 25, 2012 Posted June 25, 2012 Indeed, I do not know if the [u]alvotech.de[/u] VPS's are great, but I try to squeeze as much performance from the VPS. I do not like VPS's alvotech because use swap RAM as burst RAM. Returning to my site, if I don't have any user(visitors) online, then use RAM is less than 400Mb (with about 50 tasks). If the site connects 10 users and I have still about 25 visitors, the number of tasks increases (over 70) and RAM usage easy reach 1GB RAM, website difficult to access, even with all the forum that has with the header and footer only 9 queries. For each user visitor connected, virtual memory statistics show top command is about. 80MB. I tried unsuccessfully several optimization. It seems that apache and control panel ispCP Omega "eat" more RAM. For this reason I have to retry again and I use nginx. Then, I return to other conclusions. Thanks for reply all. 1GB of ram by php processes when 50 online? Or 1GB used by the system? To see actively used ram, you need to do... total ram - cache - buffer = true ram usage. (I find this lacking kinda poor on top) Also, 400MB at idle is a very huge hog. You might want to have an expert system admin look over your system if the stats you give are true. 50 users for 1 gig seems way too much to be reasonable. Also, excluding uber tuned minimal ram systems, centos min is usually the easy way to use lease ram as possible. cPanel is considered to be a huge hog, but it uses roughly 350MB of ram at idle with centos. Edit: I'm looking at your host's plans... I'm pretty sure it's a poor quality VPS. The pricing point simply does not make sense for it to be a quality host. Under $30/€20 are really not worth considering if you're looking for any amount of quality. VPS is supposed to be significantly more expensive than shared hosting. At the same pricing point, the vps is likely to perform worse. A dedicated is supposed to be significantly more expensive than a VPS. At the same pricing point, the dedi is likely to perform worse.
AlexJ Posted June 25, 2012 Posted June 25, 2012 Sorry to interrupt but how can u find totally memory usage for apache and per process? Just want to check my usage.
Gary. Posted June 25, 2012 Posted June 25, 2012 Sorry to interrupt but how can u find totally memory usage for apache and per process? Just want to check my usage. To see total apache you would need some perl script what I sent via PM. To see them by process in ssh type:top then hit ctrl + m This will sort the process by highest memory so you can see what and what user / task is using the most.
donpetru Posted June 27, 2012 Author Posted June 27, 2012 It seems it was a bug ispcp Omega control panel because RAM and CPU usage was so high. Now I replaced the control panel and follow the next days to test the new platform. Now, with LAMP server Debian Squeeze 6 (update and upgrade), I have RAM usage about 190Mb idle from 1024Mb and CPU usage is about 5...15%; than last time when RAM usage was 400Mb and CPU usage exceeded 50%. I think the actual values are better left to see how it behaves on a real site. However, it remains the problem with too many queries per IPC block. This problem should be resolved by IPB staff - maybe in the future IPB 4 version or earlier. So, in the few days I return with other conclusions.
Dmacleo Posted June 27, 2012 Posted June 27, 2012 fwiw zpanel is free and may be worth looking at. messed with it a bit on vps and it was fairly light, development seems to be progressing nicely.
donpetru Posted June 27, 2012 Author Posted June 27, 2012 From my humble experience with VPS control panels and beyond, we concluded that it is free, is not perfect software and is not save (secure). So, this time I will try to avoid free control panels. Better, I will buy a lifetime license ISP Manager Lite (171 Euro). I just tested this control panel and so far am very pleased. It is very safe. And another thing, can be configured web servers apache or nginx, what other control panels can not to do that and are expensive. In the next few days I will try ISP manager lite. Anyway, thanks for advice.
euantor Posted June 27, 2012 Posted June 27, 2012 Why not just rip out the panel completely? In my experience with VPS setups, you really don't need a pretty front end to get things done. Also, if you're looking to cut memory usage and improve speed regarding SQL queries, why not take a look at MariaDB rather than the traditional MySQL server? In my experience it's a lot better optimised.
donpetru Posted June 27, 2012 Author Posted June 27, 2012 MariaDB, I don't have heard but I seem to have to grow up to become a more reliable software, a worthy alternative to MySQL.... or is one "MySQL hook" (this did not really understand)! Then, I understand one solution without control panel may lead to use less RAM but what difference does the extra 40Mb (40Mb require ISP Manager Lite)! Then, there is another aspect here that is not seen by everyone, namely: if not used control panel is possible, especially for a novice user like me, to configure VPS so you use more RAM than if I use a control panel. This happens very often.
donpetru Posted June 29, 2012 Author Posted June 29, 2012 I tried ispmanager lite but is unstable when working in front of nginx and php is configured as an apache module. For this reason I decided to try CentOS + Zpanel, the problem is not able to download zinstall.sh. Here I am stuck, anyone help me? For example, I would be willing to pay someone to configure CentOS and Zpanel. Already I was bored in many control panels we install, that I think I pay someone to configure zPanel and CentOS. I wait a private message in this respect.
Dmacleo Posted June 29, 2012 Posted June 29, 2012 I've installed it few times, are you on centos6 and 64 bit? the install instructions in their forums worked fine for me. http://forums.zpanelcp.com/showthread.php?7810-OFFICIALLY-SUPPORTED-ZPanelX-CentOS-6-2-Installation-Script
Recommended Posts
Archived
This topic is now archived and is closed to further replies.