Announcement

Collapse
No announcement yet.

Performance optimization tipps

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Performance optimization tipps

    Hey,

    I am using now a new cloud server with these specs:
    • 6 CPU vCore
    • 300 GB SSD-Speicherplatz
    • 12 GB Arbeitsspeicher
    • 1 GB Swap

    And now I am looking for some "basic" tips and settings I can change to optimize my vBulletin forum


    Any tipps from you guys? Would really appreciate it!


    Last edited by zweeper; Sat 10 Oct '20, 7:42am.

  • #2
    MySQL Table Status and the PHP Info doesn't help much here.

    Generally speaking on servers with MySQL driven apps you want to optimize MySQL to so that it is able to use 80% of the server's resources. Everything else including the webserver and PHP are fine in the other 20%. Perconia has a number of tutorials on optimizing MySQL.

    On the server end (this is done in the default .htaccess)
    1. Make sure to use mod_headers (or equivalent)
    2. Set the public cache on static items to a reasonable value.
    3. Use GZIP Compression.
    4. Put vBulletin on its own sub-domain with its own virtual host configuration.
    5. Use MySQL 8+

    Don't use .htaccess. Put the directives for vBulletin in the virtual host file for your site. When you have .htaccess files, they are inherited for every directory in the path. So this adds time to serving every page.

    On the vBulletin end
    1. Use INNODB on all tables except language, phrase, and userfield.
    2. Use MemcacheD.
    3. Store CSS and SVG in the file system.
    4. Make sure you're using the fastest jQuery CDN for your users.
    5. Do not uncompress the included Javascript.
    6. Don't abuse the DOM with a lot of HTML elements. Google recommends that you keep the total elements per page under 1500. Adding a lot of modules and channels to a page will really increase this number.
    7. Investigate using a custom CDN for JavaScript, CSS, SVG, and other images.

    On a final note, ads from third-parties can significantly slow down your site. In my experience, heavy use of Google Ads can add 3-5 seconds to a page. Use with care.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment


    • #3
      Thanks wayne, I came a good step further with your tips above!

      Comment


      • #4
        Hey Wayne, one more question. What do you mean with
        • Do not uncompress the included Javascript.

        ?

        How could I even do this?

        Regards!

        Comment


        • #5
          You can reformat the JavaScript to decompress it and turn it into a human readable form using any text editor. There are also websites that can format the script text for you. Compressed JavaScript just has spaces and new lines removed plus functions and variables can be renamed to make the file smaller. It will be further compressed using gzip on the server when the end-user downloads the file for the first time.

          I use Microsoft's Visual Studio Code and its Beautify extension to do this automatically. I can use this to reformat the CSS as well. I am sure other open source editors have similar capabilities. There are also websites that can do this. You can download uncompressed JavaScript for development purposes in the Member's Area under More Download Options -> File Options -> Customize
          Translations provided by Google.

          Wayne Luke
          The Rabid Badger - a vBulletin Cloud demonstration site.
          vBulletin 5 API

          Comment


          • #6
            Thanks Wayne for this excellent explanation!

            Comment


            • #7
              Hey Wayne,

              I realize that this thread has some legs on it but it's the exact information I was looking for. I realize that sometimes it's best to pick up an older thread that's exactly on topic than it is to duplicate by opening a new one. With that said:

              I am migrating over a cloud/CDN driven site to its own server which is dual Intel XEON E5-2670 2.6 GHz processors and 16 cores / 32 threads with 64GB of DDR3 RAM. I am currently using Cent OS 7.9 64-bit. Both MariaDB and PHP are current. The overall site is an aggregated news site front-end with forums as a subdomain in a virtualized environment using Virtuozzo 7.x I am wearing white socks. Now you know absolutely everything about me. .

              I plan (planned) to use CloudFlare for the CDN. That or move it to AWS because I don't want hassles with load sharing and whatnot. I read also that you recommend putting forums alone on its own virtualized container giving it its own dedicated resources. My plan was to go one better and if the volume is as I expect.

              The one group I have is currently showing 36K new posts in four days. Without going into my business model, using vB will not be restricted to just one topic. It will be many and so optimization is going to be critical. I don't want to hassle with load balancing and clustered servers if the volume hits what I expect it's going to be, but I know that I'm not going to get this kind of performance out of AWS.

              Do you recommend LiteSpeed (expensive), EasyApache which is really intended for cpanel and I'm installed on Plesk which I prefer. Or is there another OS that you recommend for high-volume vBulletin? I've setup a subdomain up as its own configuration with its own vhost before and dedicated services so that's easy for me. But optimizing MySQL (MariaDB) & PHP is new to me. Should I be setting up PHP as CGI, FastCGI or PHP-FPM?

              I CAN go to a quad XEON server with 128k RAM but there's does vbulletin even multi-thread and multitask using multiple processors? This question of course is not intended to be sarcastic, but others I have asked had no clue or basically said that the software isn't optimized but the OS is. Well, in my 40-plus years as a programmer I know that not to be a true statement. If it were true Intel and AMD would not be working in a big way with software developers to make their software multiple CPU aware. Intel alone has over 15K developers that work with application developers to optimize for multiple processors.

              I know I've asked a lot of questions and yet I still look forward to your reply. You're extremely knowledgeable on vbulletin and that is a huge help. If you think I'm going about it the wrong way with the hardware please just give it to me straight. I'd rather find out now in the building phase then somewhere down the road. Actually right now I'm most concerned with being able to create a user type that is authorized to create a user group on the Fly.
              Last edited by Bob Ricci; Sat 5 Jun '21, 6:14am.

              Comment


              • #8
                Originally posted by Bob Ricci View Post
                Hey Wayne,
                Do you recommend LiteSpeed (expensive), EasyApache which is really intended for cpanel and I'm installed on Plesk which I prefer. Or is there another OS that you recommend for high-volume vBulletin? I've setup a subdomain up as its own configuration with its own vhost before and dedicated services so that's easy for me. But optimizing MySQL (MariaDB) & PHP is new to me. Should I be setting up PHP as CGI, FastCGI or PHP-FPM?
                I recommend that you use the web server that you're most familiar with. vBulletin is designed to be as agnostic to server and web server configurations as possible. There are customers using Redhat/CentOS, Debian (and its children), Windows and MacOS. Most customers use Apache, NGINX, or IIS but I would guess a few are using Lightspeed. This site and vBulletin cloud are run under Linux using Apache with mod_php because that is what the datacenter uses and what they are most familiar with. vBulletin will work on any server configuration as long as PHP executes properly. The only limitation that I know of is that symbolic links don't work well under PHP-FPM due to the way PHP returns URLs and a current bug in vBulletin.

                Originally posted by Bob Ricci View Post
                I am migrating over a cloud/CDN driven site to its own server which is dual Intel XEON E5-2670 2.6 GHz processors and 16 cores / 32 threads with 64GB of DDR3 RAM. I am currently using Cent OS 7.9 64-bit. Both MariaDB and PHP are current. The overall site is an aggregated news site front-end with forums as a subdomain in a virtualized environment using Virtuozzo 7.x
                This seems more than sufficient. Much more than what most of our customers are operating on. The majority of customers use shared hosting.

                Originally posted by Bob Ricci View Post
                I CAN go to a quad XEON server with 128k RAM but there's does vbulletin even multi-thread and multitask using multiple processors? This question of course is not intended to be sarcastic, but others I have asked had no clue or basically said that the software isn't optimized but the OS is. Well, in my 40-plus years as a programmer I know that not to be a true statement. If it were true Intel and AMD would not be working in a big way with software developers to make their software multiple CPU aware. Intel alone has over 15K developers that work with application developers to optimize for multiple processors.
                I want to say that vBulletin is not an application. It doesn't directly manage memory, garbage collection, or CPU threads. It is a series of PHP scripts that are interpreted at runtime to provide output. PHP has a few things that help this like allowing scripts to be pre-loaded at execution, opcode caching. vBulletin allows for items to be saved in a memory cache (memcached) as well to help with performance. Since it is a series of interpreted scripts that nominally last in memory for as long as they are executed and then discarded, vBulletin doesn't support multiple cores or threading. Script execution happens in milliseconds in most cases. It relies on the Web Server and PHP to handle resource management on the server. Since the server uses mod_php, threads and processes are handled by Apache and its configuration.

                How fast PHP handles data such as large query results from MySQL will often depend on memory allocation. The servers for this site allocate 1GB of RAM per PHP process. vBulletin Cloud sites generally start with 256 MB of RAM allocated per PHP Process. This doesn't mean that PHP will use this much for every script. It is the maximum it can use before the script is terminated.

                In general, the MySQL/MariaDB server will take most resources. I believe most server optimization experts recommend that 80% of the server resources be allocated to MySQL. In house, the databases on separate virtual machines from the web server. I don't know if they are on the same physical server or not. I also don't know what they use to control virtualization. I don't think that really matters.
                Translations provided by Google.

                Wayne Luke
                The Rabid Badger - a vBulletin Cloud demonstration site.
                vBulletin 5 API

                Comment


                • #9
                  I would add this.

                  On a shared hosting plan with cPanel, you can set PHP Memory Limit to -1 using MultiPHP INI Editor/Configure PHP INI basic settings/PHP Directive on cPanel. If allowed, the forum will run with all the memory available on the server.

                  Comment


                  • #10
                    I don't recommend setting the memory limit to -1. The memory limit is there to prevent a never ending loop from bringing down the entire server. There is no reason for PHP to use all the memory on the server.
                    Translations provided by Google.

                    Wayne Luke
                    The Rabid Badger - a vBulletin Cloud demonstration site.
                    vBulletin 5 API

                    Comment


                    • #11
                      Originally posted by Wayne Luke View Post
                      I don't recommend setting the memory limit to -1. The memory limit is there to prevent a never ending loop from bringing down the entire server. There is no reason for PHP to use all the memory on the server.
                      Thank you very much for such a detailed reply. I'm actually expecting a large volume of traffic with many, many user groups. Not so much on the forums. That's why I asked about multi-threading and multitasking. As a phb programmer I certainly understand what you've written. I know that the script went properly written as I know they are in this case execute instantaneously. It's generally a matter of Apache and how many concurrent users it can handle. That's usually where Litespeed comes in. But they charge by the core and it is not cheap. I do have NGINX and my choice of whether I run plesk or cpanel because as the owner of the hosting company I have both. I also have direct admin.

                      My question is all about performance and what I can do to enhance capabilities as the traffic increases. As I mentioned I already have over 86k users. We're still on that dreaded Facebook and in 5 days have had over 46k messages in one group alone.

                      CHANNELS: I do have an unrelated question about user groups vs. Channels. In the documentation it refers to user groups. But in the user permission set up it refers to channels. Are they the same thing? A channel equals UserGroup? I don't see any clarification on that.

                      Comment


                      • #12
                        Channels are content Containers. Forums, Article Categories, Blogs, Groups. These contain topics, photo galleries, events, polls, and links.
                        Usergroups are similar to Roles. Administrator, Super Moderator, Moderator, Guest, Registered Users, etc...

                        You can control which usergroups can access a channel on a channel by channel basis using permissions.
                        Translations provided by Google.

                        Wayne Luke
                        The Rabid Badger - a vBulletin Cloud demonstration site.
                        vBulletin 5 API

                        Comment

                        Related Topics

                        Collapse

                        Working...
                        X