ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    How to tune or optimize MySQL or MariaDB ?

    IT Discussion
    3
    13
    772
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Emad RE
      Emad R
      last edited by Emad R

      I ran into this a lot lately, and I dont know what to use as a good base.

      I do google search and find many variables and try to understand as many as possible but the thing is you worry that too much changing would affect the integrity of the database.

      And since when optimizing database would require 10 performance variables, why cant we select something pre-made, I recall windows versions had something called small.ini/medium/large.

      I dont think I should need to learn all that on top of building an application, I think it is stuff like this why people choose Oracle or MS SQL

      This whole thing started when I began using centos with openfire, and I noticed everything is working but when pressing the users/groups in openfire it was slow (5 seconds) to show list of users which is like 60 users, and the same openfire in Windows using the integrated database was much faster, thus I reckon I need to optimize mariadb version 5.

      So what is the main thing I should put in /etc/my.cnf
      I reckon that it comes reconfigured that it will run in small ram environment perhaps ?

      What I want to do is the minimalist config changes that will give me the best performance outcome.

      Using InnoDB.

      Thanks.

      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        Why do you feel that all this tuning is needed? And why do you feel that Oracle or SQL server would be different? Conventional experience is the opposite, those tend towards far more tuning and MariaDB less. I've never known anyone to need to tune their MariaDB. Not that you never would, but this doesn't affect most people and is certainly not a decision factor.

        What kind of extreme resource limits are you under to produce this concern?

        Emad RE 1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by

          Integrated databases are often much faster. Especially at small sizes. If you are heavily constrained, I would expect SQLite to be faster since the RDBMS doesn't need to be loaded and no network overhead is needed.

          Emad RE 1 Reply Last reply Reply Quote 2
          • scottalanmillerS
            scottalanmiller
            last edited by

            Are you sure that the delays are coming from the database and not the application? MariaDB is screaming fast. Perhaps you have an IOPS problem and the system is blocked on the operation. There is not way that the database is taking five seconds to respond. That's not a reasonable assumption. Something else is wrong.

            1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller
              last edited by

              Perhaps you are out of memory? This could be extreme swapping?

              Emad RE 1 Reply Last reply Reply Quote 0
              • Emad RE
                Emad R @scottalanmiller
                last edited by

                @scottalanmiller said in How to tune or optimize MySQL or MariaDB ?:

                What kind of extreme resource limits are you under to produce this concern?

                the fact that the web is wealthy with documents and variables to speed up mariadb/mysql

                things like:
                innodb_buffer_pool_size
                innodb_log_file_size
                innodb_file_per_table
                innodb_flush_log_at_trx_commit
                query_cache_size
                ...etc

                All this got me thinking what are the defaults of Centos MariaDB installation, and are they enough to handle any load ?

                And the VM have 2GB of RAM btw.

                scottalanmillerS 1 Reply Last reply Reply Quote 0
                • Emad RE
                  Emad R @scottalanmiller
                  last edited by

                  @scottalanmiller

                  using free -m I am using 512 of 2GB ram

                  1 Reply Last reply Reply Quote 0
                  • Emad RE
                    Emad R @scottalanmiller
                    last edited by

                    @scottalanmiller said in How to tune or optimize MySQL or MariaDB ?:

                    Integrated databases are often much faster. Especially at small sizes. If you are heavily constrained, I would expect SQLite to be faster since the RDBMS doesn't need to be loaded and no network overhead is needed.

                    I guess this is it really then, to be honest it is more like 3 seconds, but with the integrated database it was very fast, thus I noticed it.

                    scottalanmillerS 2 Replies Last reply Reply Quote 0
                    • scottalanmillerS
                      scottalanmiller @Emad R
                      last edited by

                      @msff-amman-Itofficer said in How to tune or optimize MySQL or MariaDB ?:

                      @scottalanmiller said in How to tune or optimize MySQL or MariaDB ?:

                      What kind of extreme resource limits are you under to produce this concern?

                      the fact that the web is wealthy with documents and variables to speed up mariadb/mysql

                      things like:
                      innodb_buffer_pool_size
                      innodb_log_file_size
                      innodb_file_per_table
                      innodb_flush_log_at_trx_commit
                      query_cache_size
                      ...etc

                      All this got me thinking what are the defaults of Centos MariaDB installation, and are they enough to handle any load ?

                      And the VM have 2GB of RAM btw.

                      You haven't even mentioned what database engine you are using. I'm assuming InnoDB but that's not the most common with MariaDB. But just because the Internet is full of people talking about it doesn't tell us that it is appropriated or useful. The web is full of people recommended RAID 5 for databases but we know that's crazy (till SSD).

                      1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @Emad R
                        last edited by

                        @msff-amman-Itofficer said in How to tune or optimize MySQL or MariaDB ?:

                        @scottalanmiller said in How to tune or optimize MySQL or MariaDB ?:

                        Integrated databases are often much faster. Especially at small sizes. If you are heavily constrained, I would expect SQLite to be faster since the RDBMS doesn't need to be loaded and no network overhead is needed.

                        I guess this is it really then, to be honest it is more like 3 seconds, but with the integrated database it was very fast, thus I noticed it.

                        But you changed everything, not just the database. It's not reasonable to think that the database is the factor in question. Possible, yes. Likely? Not at all.

                        1 Reply Last reply Reply Quote 0
                        • scottalanmillerS
                          scottalanmiller @Emad R
                          last edited by

                          @msff-amman-Itofficer said in How to tune or optimize MySQL or MariaDB ?:

                          @scottalanmiller said in How to tune or optimize MySQL or MariaDB ?:

                          Integrated databases are often much faster. Especially at small sizes. If you are heavily constrained, I would expect SQLite to be faster since the RDBMS doesn't need to be loaded and no network overhead is needed.

                          I guess this is it really then, to be honest it is more like 3 seconds, but with the integrated database it was very fast, thus I noticed it.

                          No. There is no realistic possibility that this is it. Not even slightly.

                          JaredBuschJ 1 Reply Last reply Reply Quote 0
                          • JaredBuschJ
                            JaredBusch @scottalanmiller
                            last edited by

                            @scottalanmiller said in How to tune or optimize MySQL or MariaDB ?:

                            @msff-amman-Itofficer said in How to tune or optimize MySQL or MariaDB ?:

                            @scottalanmiller said in How to tune or optimize MySQL or MariaDB ?:

                            Integrated databases are often much faster. Especially at small sizes. If you are heavily constrained, I would expect SQLite to be faster since the RDBMS doesn't need to be loaded and no network overhead is needed.

                            I guess this is it really then, to be honest it is more like 3 seconds, but with the integrated database it was very fast, thus I noticed it.

                            No. There is no realistic possibility that this is it. Not even slightly.

                            Exactly. The ScreenConnect server performs like crap on Linux compared to Windows. But the problem is not the database. It is the .NET framework.

                            scottalanmillerS 1 Reply Last reply Reply Quote 0
                            • scottalanmillerS
                              scottalanmiller @JaredBusch
                              last edited by

                              @JaredBusch said in How to tune or optimize MySQL or MariaDB ?:

                              Exactly. The ScreenConnect server performs like crap on Linux compared to Windows. But the problem is not the database. It is the .NET framework.

                              Right, I could totally see there being an application layer issue. Or a hardware problem. Or the system just being over-taxed. So many options. But that MariaDB isn't "tuned" for this, that's not a possibility. We'd measure the database response time for this in milliseconds, not seconds. And only sixty records? I've got MySQL on ancient systems with a fraction of these resources that will return literally millions of records in less time than that.

                              1 Reply Last reply Reply Quote 0
                              • 1 / 1
                              • First post
                                Last post