-
Notifications
You must be signed in to change notification settings - Fork 91
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
Comments
Hi
The simple answer is, no there isn't.
This tool isn't really something intended to be used as part of an HTTP request, as the job could take a long time to complete.
You would usually run this on the command line or initiate it in a worker as part of a job queue.
If you could tell me a bit more about your use case and any constraints you have I might be able to suggest a pattern that could work.
Cheers
Joe Green
… On 7 May 2022, at 06:43, Josh Rosario ***@***.***> wrote:
Is there a complete example anywhere of how to use this on a PHP web page?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
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? |
It's hard to say for sure, but it doesn't sound like the sort of thing this tool is intended for.
This tool is for use in fairly specific scenarios where a copy of a database is needed and standard techniques for replicating data can't be used, for example:
- Synchronise a transactional database serving an application with an "offline" version for slow analytics queries.
- Pre-load a database ahead of a data migration where a replica can't be used
The kind of problem you are describing sounds like a situation where a local application cache might help, or query optimisation to reduce disk usage on the RDS instance.
Are the high IOPS due to reads or writes?
I'm not sure if running MySQL on your application server is a good idea or not but if it's something you choose to do, then why bother syncing to RDS at all?
Cheers
Joe Green
… On 15 Aug 2022, at 19:49, kapyaar ***@***.***> wrote:
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?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.
|
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 CRONTAB Entry: |
@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. |
Is there a complete example anywhere of how to use this on a PHP web page?
The text was updated successfully, but these errors were encountered: