~ overflow ~

Archive for April, 2011

Change sendmail’s outgoing ip

by admin on Apr.16, 2011, under Linux Happyness

Problem:

How to change sendmail’s outgoing ip?

Solution:

This is the ip that will be used to deliver messages, this ip might get blacklisted if one of your happy clients on a shared server decides to send a mass email.
Sendmail is always a bitch to config, but this time it wasn’t, just change your .m4 file adding:

CLIENT_OPTIONS(`Addr=123.456.789')dnl

rebuild the .cf file, restart sendmail and you’re done. In my case, I had a specific ip on the server that got “temporary” (permanently) blocked by gmail. Although new mail wasn’t being sent after the flood, google never unblocked my server, even after a week i still getting “limit rate exceeded” messages. Since I have many IPs on the server it was easier just to bind sendmail to another IP.

Source:

Server Fault

Leave a Comment :, , , more...

MySQL InnoDB ibdata size

by z3n on Apr.03, 2011, under Tips & Hints

Problem:

MySQL InnoDB ibdata file size never shrinks no matter if you deleted a big database / table or whatever.

Solution:

There is no easy solution for this, according to mysql this is supposed to be a bug, however they never fixed it since, apparently, there’s not many people around deleting big tables / databases.

Looking around, someone suggested that recreating the whole dataset would help fixing the issue, since we won’t be having trash on the innodb ibdata file.

Recreating the whole dataset is a extremely time consuming task, you would need to do a dump of every database, completly delete mysql data folder, create a new one with defaults, and inject the dump file. Just for example, on my dev machine i run about 100 different databases the total size is around 8GB, innodb was 20GB, wasting a lot of space on my precious SSD, so dumping everything, doing backups and injecting the whole data took over 8 hours, which is something nobody can take on a production server.

After some more research I’ve found about a specific configuration switch:

innodb_file_per_table

This is what you should have on your my.cnf or my.ini into the innodb branch. Instead of creating one big innodb ibdata for every single innodb table across all databases, this switch will create a `.ibd` file for each of the the innodb tables. Those files will be stored inside the database folder, so if you eventually have a greatly sized table you just need to drop it and recreate the single table to avoid gigantic innodb .ibd files instead of doing a full database recreation.

If you don’t have time to recreate everything you can just add `innodb_file_per_table` into the config, so new tables will be created using the new scheme.

The only con i can think about this switch is because you will have one extra file that will have to be seeked and will incrase the overhead when doing table joins and so on, although the disk overhead should be minimal, if you have thousands of tables into the same db it might make some difference, if you relay on speed you should do some benchmarks to make sure.

Bug Tracking:

bugs.mysql.com

Leave a Comment :, , , , more...

Finding big files on linux

by z3n on Apr.02, 2011, under Linux Happyness

Problem:

How to find big files on linux?

Solution:

 find / -type f -size +50000k

This will find files bigger than 50MB (50000k)

Leave a Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!