Find Jobs
Hire Freelancers

OpenCart DB query slowing down the site sometimes

₹1500-12500 INR

クローズ
投稿日: 5年以上前

₹1500-12500 INR

完了時にお支払い
Hi, The site ([login to view URL]) is built on Opencart 3 (Journal 3 theme + AWS Lamp T2 medium). Site's working fine mostly, but sometimes the server CPU utilization shoots up to 200% (2 cores) because of one mysql query. On setting up a slow_query log and testing with few orders, there's this particular query which takes the most time. SELECT c.category_id, c.parent_id, [login to view URL] as title , ( SELECT COUNT(p.product_id) FROM oc_product_to_category p2c LEFT JOIN oc_product p ON (p.product_id = p2c.product_id) LEFT JOIN oc_product_to_store p2s ON (p.product_id = p2s.product_id) WHERE [login to view URL] = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' AND p2c.category_id = c.category_id) as total FROM oc_category c LEFT JOIN oc_category_description cd ON (c.category_id = cd.category_id) LEFT JOIN oc_category_to_store c2s ON (c.category_id = c2s.category_id) WHERE cd.language_id = '1' AND c2s.store_id = '0' AND [login to view URL] = '1' ORDER BY c.sort_order, LCASE([login to view URL]); I think this is a generic query which outputs the table of category IDs { cat_id, parent_id, name, product count } . When run on localhost, please find the output of the query in File 1. PFA the action records which we tested in columns A-F in excel file. Columns I & J have the execution time and timestamp of the slow_query_log. PFA the dump of slow_query_db log too. PFA Cloudwatch CPU utlization graph too. I want to know the rootcause behind why this query takes 1) When and why is this query getting called? 2) Why is average time to execute high? ( it processes 84 lakh rows) 3) What is the alternative way of getting this done quickly without affecting site performance and utility? 4) Why is this query sometimes taking too long? Why is it VARYING sometimes and the other times the site is working smoothly?
プロジェクト ID: 18250021

プロジェクトについて

5個の提案
リモートプロジェクト
アクティブ 5年前

お金を稼ぎたいですか?

Freelancerで入札する利点

予算と期間を設定してください
仕事で報酬を得る
提案をご説明ください
登録して仕事に入札するのは無料です
この仕事に5人のフリーランサーが、平均₹5,342 INRで入札しています
ユーザーアバター
Hi, I am Opencart expert and speed optimzer. I will optimize that sql query so it will run fast everytime. Harsh
₹1,500 INR 3日以内
4.9 (627 レビュー)
8.2
8.2
ユーザーアバター
yes sure I can help you now.
₹11,111 INR 2日以内
4.9 (121 レビュー)
6.3
6.3
ユーザーアバター
Hi, I have seen the query you have sent and noticed that the complex quries like this are slowing your system. See as per my knowledge here every application should take easy step on database server whereas application server can be extendes but databse servers have limits. Simple queries should be there to get your server a good loading time. I can modify the query time and further debug your system to get its loding time issue resolved. Please reply to have a chat in detail. Yes, for the matter of dealing with opencart i have worked for 1 year on it and devloped 4 sites up till now on opencart. I have also used the theme you mentioned, so i know about it also.
₹1,850 INR 2日以内
0.0 (0 レビュー)
0.0
0.0

クライアントについて

INDIAのフラグ
Ahmedabad, India
0.0
0
お支払い方法確認済み
メンバー登録日:11月 1, 2018

クライアント確認

ありがとうございます!無料クレジットを受け取るリンクをメールしました。
メールを送信中に問題が発生しました。もう一度お試しください。
登録ユーザー 投稿された仕事の合計
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
プレビューを読み込み中
位置情報へのアクセスが許可されました。
あなたのログインセッションの有効期限がきれ、ログアウトされました。もう一度ログインしてください。