Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use as PHP page #51

Open
joshrosario310 opened this issue May 7, 2022 · 5 comments
Open

How to use as PHP page #51

joshrosario310 opened this issue May 7, 2022 · 5 comments

Comments

@joshrosario310
Copy link

Is there a complete example anywhere of how to use this on a PHP web page?

@mrjgreen
Copy link
Owner

mrjgreen commented May 7, 2022 via email

@kapyaar
Copy link

kapyaar commented Aug 15, 2022

Hello Joe,

I am chipping in on this. I have a use case where a php application on AWS EC2 is using an RDS server. Due to the number of requests, I am using up large number of IOPS, and I am looking to reduce the RDS cost. One thought is to have a mysql server installed on the EC2 which hosts the php application, use that as the active db, and then every day, run a cron which will evoke your script to sync this mysql to the RDS mysql. Would this be use case that can employ your script?

@mrjgreen
Copy link
Owner

mrjgreen commented Aug 15, 2022 via email

@pottertech
Copy link

I have done this in the past with something like the following shell script and a cron running once a day at 1am:

script name and command: dbTOdb.sh
db-sync --user admin --password ‘adminPassWord’ 10.3.7.118:3306 10.3.7.229:3306 CryptoDB.ohlcv --target.table HistoryDB.ohlcv --execute --quiet

CRONTAB Entry:
0 1 * * * /root/dbTOdb.sh &

@kapyaar
Copy link

kapyaar commented Aug 15, 2022

@pottertech Thanks for the info, This could come in handy.

@mrjgreen We are using up IOPS because we have a large number of writes (See my question https://stackoverflow.com/questions/73347922/is-it-possible-to-collect-mysql-queries-from-independent-rest-api-requests-to-a).

Query optimizations have been performed, Cache is already there I believe based on the RDS parameter settings, and the select queries are using the cache, not hitting the db if not needed. it is the sheer number of mandatory writes that I need to perform to update timestamps that I think is the root cause. Hence my idea that if I can keep a local mysql and run the application off of that, then I don't have to do all the writes to the RDS.

Now, why RDS? Well The reliability , automated backing up, security, etc is a nice to have. So, I could keep the RDS, just cut down on the queries/ IOPS/ and this will also help improve performance as well. Atleast how I see this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants