Emergency

What status variables to monitor when running a large ALTER TABLE

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • What status variables to monitor when running a large ALTER TABLE

    Hi,

    First post so apologies for any failure to adhere to community standards.

    I am not a MySQL (or any kind of DB) expert and have just recently discovered the pt-online-schema-change tool which is right now looking like a life saver. My problem is just that I am unsure how I can effectively use the --max-load option to ensure the DB is not overloaded during the change. The DB is written to by a single thread and so the default behaviour to monitor active threads is not a great way for me to measure the load. I would prefer something CPU based, as CPU is generally the constraining resource on our server. Is there anything which would offer this kind of functionality here? Alternatively if it is possible to tell how long queries are taking to execute that might work. Open to other suggestions but CPU is the obvious best choice to me.

    Thanks
    Joe

  • #2
    Hi,

    The tool automatically tries to not to interfere with your regular DB access by constantly checking how long it takes to copy every chunk of rows.
    https://www.percona.com/doc/percona-...nge-chunk-time

    Regarding the estimated time to complete the migration: there is no way to know in advance how long it is going to take because the time depends on too many variables.
    What I could recommend is: try it first on a copy if possible.

    Regards

    Comment

    Working...
    X