# Database and jail question



## fred974 (Jan 14, 2014)

Hello,

I'm running several websites on  Nginx web server with a MySQL database. I now want to mess about and try to do my own mail server. Is there any problem in running MySQL and postgresql along side each other? Either in the same jail or a different jail?

Thank you


----------



## ShelLuser (Jan 14, 2014)

Shouldn't be a problem at all. PostgreSQL usually binds itself on port 5432 whereas MySQL uses 3306. Next is the data itself which is also kept in different places, so there should be no problem at all running these two side by side.

Of course; it can become an issue if both environments are heavily used. After all; the one thing a database environment really likes to have is memory.


----------



## fred974 (Jan 14, 2014)

Thank you @ShelLuser,

Would you have each database in their own jails or in a single one?

Fred


----------



## ShelLuser (Jan 15, 2014)

Depends what you'll be using them for. But I think you might gain more flexibility when using a separate jail for each of those environments, but do keep in mind that I say so while keeping rctl(8) in mind (which isn't enabled by default).

Applying resource control limits on an entire jail is quite easy; you can do this by simply referring to one. Although you can also apply limits on a process-basis you need to keep in mind that both PostgreSQL and MySQL will both utilize multiple processes, as such it would make it much harder to apply any limits.

So I'd go for a single jail.


----------



## fred974 (Jan 15, 2014)

Thank you @ShelLuser


----------

