When it comes to dynamic websites, there is always a need for faster page loads, highly responsive servers and ecstatic clients. These are all recipes for high level efficiency for websites.
When it comes to web server performance then, what can be done to enhance the efficiency of MySQL server? Some would say that caching is what makes the difference. Some claim that indexing is the best way to squeeze every millisecond out of MySQL server? Which of these worked for you? Is there any other unconventional measure you deployed to optimize server response time on MySQL database? Would love to hear?
Actually, it’s a topic I’ve always wanted to learn more about, but mastering it isn’t something that can be done quickly. Unfortunately, I don’t have much time to dedicate to it right now. Becoming a Database Administrator (DBA) is a lengthy process; it’s not just a matter of making a few tweaks. It involves continuous monitoring and making informed decisions based on various metrics. Despite the challenges, Redis cache has significantly improved my performance.
I manage self-hosted WordPress sites, and while I’ve mastered some aspects, optimizing MySQL or MariaDB is an ongoing learning process for me. I came across a tool called Releem, which is free and gathers metrics from your server, providing suggestions for improvements. Although I appreciate its well-documented knowledge base, I’m cautious about installing tools on my server without a clear understanding of their operations.
One tool I have found helpful is MySQL Tuner. It has proven beneficial in many situations, offering recommendations based on real-life scenarios.
Indexing the common requests is the fastest way to reduce query time. It makes your requests 20x-100x faster depending on the items that the database has.
You can also consider reducing the connected table queries. Queries made from linked tables are one of the main factors that reduce speed. If you have a database that has many linked tables, you may consider using one of the NoSQL databases and saving the linked tables on the base table. With that, you don’t need to query multiple tables and it’ll reduce the query time.
@ivansalloum i dont use mysql server but do i use a lot of other server. coming from the red hat or the server side, i can recommend you this.
$sudo apt-get install smemstat
# it is a memory profiler for the servers
# now you can make a string array for the same
read -r -p "please enter the sleep time:" number
threshold="256M"
declare -A sleep=()
for i in $(semstat | cut -f "column you want")
do
sleep+=("$i")
done
# now opening a second iteration to limit the threshold
for i in "${sleep}"
do
if [[ "${i}" -le "${threshold}" ]]
then
sleep "${number}"
fi
done
@ivansalloum thank you and if you using that for the kubectl or the kubectl pods like
$kubectl shell pods
then you can list and add one more iterator and at that time you can
import the GO language such as
import fmt {
var := int
var:=str
}
and you can incorporate that directly.