innodb - Google Cloud: MySQL queries very slow -
after deploy on google cloud app had big latency, on 5s. after searching problem, find out queries on mysql database problem , taking long execute.
here examples same database compared on different servers. commands issued through ssh directly on sql server:
select * tbl1; local - 54343 rows in set (0.14 sec) shared hosting - 54343 rows in set (0.89 sec) google - 54343 rows in set (26.73 sec) select * tbl2; local - 132 rows in set (0.00 sec) shared hosting - 132 rows in set (0.01 sec) google - 132 rows in set (0.20 sec) select * tbl3 inner join tbl4 on tbl4.tbl3_id = tbl3.id; local - 746 rows in set (0.00 sec) shared hosting - 746 rows in set (0.12 sec) google - 746 rows in set (0.95 sec)
i using d1, tried d32 tier didn't better results. using default setup (flags etc.). think cause problem ? have tried async file system repc., turn off logging flags.
given local query times short, large number of rows, suspect query cache may @ play here.
try queries both locally , remote using sql_no_cache this:
select sql_no_cache * tbl3 inner join tbl4 on tbl4.tbl3_id = tbl3.id;
if evens out times, query cache not configured on google server. enabling might give start now, however, if have queries taking multiple seconds regularly need @ optimising them.
Comments
Post a Comment