Re: How to slim MySQL?

2010-07-07 Thread Nima Mohammadi
On Tue, Jul 6, 2010 at 8:39 PM, Andrés Tello  wrote:

> The more information, the easiest to pinpoint solutions.
>
> delete all client and administrativ tools (mysql, mysqladmin, etc from the
> "server", since you aren't doing any transactions, I think you can ditch all
> engines excepto the isam/myisam, the basic one, also you migth want to leave
> memory engine...
>
> If I understand your project, you migth copy the database to the ram into a
> tmpfs and if any change is needed, you update it, maybe to another engine??
>
> What would I do. Build  mysql in some machine, only copy mysqld and it's
> libraries, start it and trace it with strace -e open to see what files does
> it needs at startup. Supply them.
>
> Add the database, run the aplication.
>
> If not working, repeat... until it works...
>
> that would be my approach, I think that would take like... 2 days at most.
> Don't think about leaning down the mysql, better thik about providing what
> it barely needs to run properly.
>
> Good luck.
>
>
It seems like a reasonable (though time-consuming) approach. I'm going to
give it a try. I think watching for the open() function will suffice (strace
-e open). Is there any other syscall I should be worry about?

-- Nima Mohammadi


Re: How to slim MySQL?

2010-07-06 Thread Nima Mohammadi
On Tue, Jul 6, 2010 at 7:10 PM, mos  wrote:

> Roam,
>   Why are you installing a client server database on an embedded
> system? There are better databases for this task. In the past I've been able
> to squeeze a Windows application and an SQL database so it could run
> directly off of a floppy disk (remember those?). But it wasn't client
> server. :) It seems to me you are trying to fit an elephant into a phone
> booth. Just don't expect it to sit up and dance.
>
> BTW, where are the MySQL temp files going to go? Like the ones used for
> sorting the table? Also are you going to have crash recovery in case the
> machine gets accidentally powered off and damages the database?
>
> Mike
>
>
As I previously said, deciding which RBMS to use is not up to me. Actually I
myself suggested SQLite, but the system has already been designed and it's
not possible to change the plans.
Our case doesn't fit into your analogy (elephant and phone booth). The
system has a powerful processor, 2GB of RAM and broadcasts video over the
network. But the operating system resides on a flash memory. The client
program, used to receive the stream, connects to the MySQL server to do some
ACL and authentication stuff. There are some stored procedure in the DB
which does the job.
The purpose of using a flash memory and a read-only ramfs was to conqueror
the "accidentally powering off" part! It will update the flash memory when
we command it to do so.
Hope the scenario is clear now!
Did you really need this explanation to answer my question?

-- Nima Mohammadi


Re: How to slim MySQL?

2010-07-06 Thread Nima Mohammadi
On Tue, Jul 6, 2010 at 2:00 PM, Joerg Bruehe  wrote:

> Hi!
>
>
> Nima Mohammadi wrote:
> > On Mon, Jul 5, 2010 at 8:26 PM, Rob Wultsch  wrote:
> >
> >> [[...]]
> >>
> >> You probably want to compile your own version of MySQL. You probably
> >> want to remove debugging symbols* (which have been present since the
> >> mid 5.0 series, iirc), and any engines/character sets/etc you don't
> >> need.
> >>
> >> *Alternatively you can run the strip command.
> >>
> >> --
> >> Rob Wultsch
> >> wult...@gmail.com
> >>
> >
> > [[...]]
> > I guess for removing debug symbols I need to add the "--without-debug"
> > option to the ./configure command. I think using these options would also
> be
> > helpful:
> >
> >- --without-man
> >- --without-docs
>
> This will affect the package size, but not the individual binary.
>
> >- --without-ipv6
> >- --disable-largefile
>
> "largefile" shouldn't have a big effect on size, but in a tiny embedded
> system you probably really don't need it.
>
> >
> > I'm not sure which engine we're going to use, so I'll have to defer this
> to
> > another time.
>
> The engine will be quite important, stripping all engines you don't need
> will have the largest effect on size.
>
> > Is there any other work I could do to strip MySQL?
>
> Check the character sets you configure, get rid of those you don't need.
>
> You might look into compiler options optimizing for space rather than
> for speed, but I hope you are not that much limited by your system.
>
> If you want to run client/server as separate binaries, you can use
> "--without-embedded". However, I guess linking the server part to the
> application will have a big effect on space requirements, so you really
> should look into that.
>
> Are you using version 5.1 or 5.5 ?
>
>
> Jörg
>
> --
> Joerg Bruehe,  MySQL Build Team,  joerg.bru...@sun.com
> ORACLE Deutschland B.V. & Co. KG,   Komturstrasse 18a,   D-12099 Berlin
> Geschaeftsfuehrer: Juergen Kunz, Marcel v.d. Molen, Alexander v.d. Ven
> Amtsgericht Muenchen: HRA 95603
>
>
Thanks for your help. Your answer was quite helpful :)
I'm not sure what "--without-embedded" option does but I'll certainly
consider that.
We are using MySQL 5.1.

-- Nima Mohammadi


Re: How to slim MySQL?

2010-07-05 Thread Nima Mohammadi
On Mon, Jul 5, 2010 at 10:11 PM, Rob Wultsch  wrote:


> This is not a topic I have worked with previously.  I image this may
> be a good topic to bring to a consulting company (specifically Percona
> and Open Query might work well) if you are unable to meet your size
> goals.
>
>
>
> --
> Rob Wultsch
> wult...@gmail.com
>

As a low budget, semi-student project, I don't see that as an option!

*-- Nima Mohammadi*


Re: How to slim MySQL?

2010-07-05 Thread Nima Mohammadi
On Mon, Jul 5, 2010 at 8:26 PM, Rob Wultsch  wrote:

>
> Have you considered SQLite?
>
> You probably want to compile your own version of MySQL. You probably
> want to remove debugging symbols* (which have been present since the
> mid 5.0 series, iirc), and any engines/character sets/etc you don't
> need.
>
> *Alternatively you can run the strip command.
>
> --
> Rob Wultsch
> wult...@gmail.com
>

Well, I'm not in charge of deciding which RDBMS to use and the MySQL is
needed for a program which has already been written. So it seems that we
have no choice but to stick with MySQL.
I guess for removing debug symbols I need to add the "--without-debug"
option to the ./configure command. I think using these options would also be
helpful:

   - --without-man
   - --without-docs
   - --without-ipv6
   - --disable-largefile

I'm not sure which engine we're going to use, so I'll have to defer this to
another time.
Is there any other work I could do to strip MySQL?

*-- Nima Mohammadi*