I've below configuration on google cloud SQL. I didn't get enough speed on queries. its considerably slower then i run on my local machine.
We are using InnoDB engine. we have user table over 50k~ records. and if we do simple update query to update single row.
UPDATE User SET notificationToken="string token" WHERE id = "String ID";
Here id column is varchar and we have assign index primary key + unique key. and the above query took 1+ sec to update record. same query if i try on my local machine it tooks 0.0200ms. write operation seems too much slow in cloud sql.
Any guidance on below configuration or need to configure DB flags for InnoDB?
Cloud SQL Configuration:
Machine Type:
- db-n1-standard-2
- vCPUs: 2
- Memory: 7.5 GB
Network throughtput (MB/s): 500 of 2,000 Storage Type: SSD Storage Capacity: 10GB
Disk throughtput:
- Read: 4.8 MAX:240.0
- Write: 4.8 MAX:144.0
IOPS:
- Read:300 MAX:15,000
- Write:300 MAX:9,000
DB Flags:
- slow_query_log='on'
- long_query_time = '1'
- query_cache_size='223338299392'
- query_cache_limit='223338299392'
- stored_program_cache=524288
- sql_mode='ERROR_FOR_DIVISION_BY_ZERO'
- log_bin_trust_function_creators='on'
- innodb_write_io_threads=20
- innodb_read_io_threads='8'