Posts: 22
Joined: Mon Oct 27, 2014 8:03 pm

Run MySQL on Pi

Tue Apr 11, 2017 6:44 am

Hi Guys,

just a general question, is there a real bottleneck when I run a MySQL Server on a Pi3 ?

I want to start a project and would need a small Webserver including a Database but don't want to pay for a official one until first release.

Would a Pi3 be capable for this ?

It is no Big Data in this game, so nothing to be calculated with too much resources.


Posts: 720
Joined: Sun Apr 17, 2016 4:00 am

Re: Run MySQL on Pi

Tue Apr 11, 2017 6:50 am

The microSD card is the first bottleneck. The speeds quoted are usually for continuous writes of video files. Cheap cards are very slow at writing the small blocks of data updated in a database. A faster card is a good investment for a database style application.

After that, the 20 ~ 30 MB/s USB 2 throughput will be a limit. The Pi 3's four cores and the fast graphics unit in every model Pi are unlikely to limit you.

Posts: 22
Joined: Mon Oct 27, 2014 8:03 pm

Re: Run MySQL on Pi

Tue Apr 11, 2017 6:56 am

Thanks mate.

A Class 10 SD Card shouldnt be that bad I think for the project.

And a small delay would also not be a problem for me, because I want to use it only for some beta tests as long the Pi is not completely overloaded with that read/write access on it.

After first success i want to migrate it in an official paid provider.

So if the Pi can handle this I would like to start developing on it to keep the costs as minimal as possible.

User avatar
Posts: 37614
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Run MySQL on Pi

Tue Apr 11, 2017 9:17 am

There's also a RAM bottleneck, because the default settings in /etc/mysql/my.cnf assume your machine has about 4GB of RAM.

You need to tune the RAM buffer pools down to about a quarter of their default sizes. If you over-commit RAM your RPi will use the SDCard for paging. That is very bad as it a) wears out the SDCard quicker and b) is as slow as wading through treacle.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Posts: 18
Joined: Sun Dec 04, 2016 6:08 pm

Re: Run MySQL on Pi

Tue Apr 11, 2017 2:42 pm

Disk issues can be resolved by using an external drive like a WD Pi drive. The 314 drive is inexpensive at about $40. I ran a plex server on a 1T pi drive until I ran out of space. Blazingly fast compared to running on an SD card.


Return to “Beginners”