Increasing the MySQL packet size limit

By default, the highest MySQL queries length is 1 MB. This results in limiting the maximum number of files that MassTransit can handle in certain situations to 150,000. For example:

However, by configuring the max_allowed_packet setting, you can increase the MySQL queries length in order to allow transfers of more than 150,000 files. To do that:

Open the my.ini file in a plain text editor. You can find the my.ini file in the MySQL installation folder, by default:

  1. for MySQL 5.1:
    1. on 32-bit machines:

    %Program Files%\MySQL\MySQL Server 5.1

    1. on 64-bit machines:

    %Program Files (x86)%\MySQL\MySQL Server 5.1

  2. for MySQL 5.0:
    1. on 32-bit machines:

      %Program Files%\MySQL\MySQL Server 5.0

    2. on 64-bit machines:

      %Program Files (x86)%\MySQL\MySQL Server 5.0

  3. To increase the maximum length of the MySQL queries to 4 MB, add the following line at the bottom of the my.ini file :

    max_allowed_packet=4194304

  4. Save and close the my.ini file.
  5. Stop the MassTransit services.
  6. Restart the MySQL service in Windows Services.
  7. Start the MassTransit services.

Now, you can transfer more than 150 000 files with MassTransit.