Re: How to slim MySQL?

2010-07-07 Thread Nima Mohammadi
On Tue, Jul 6, 2010 at 8:39 PM, Andrés Tello mr.crip...@gmail.com 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 Joerg Bruehe
Hi!


Nima Mohammadi wrote:
 On Mon, Jul 5, 2010 at 8:26 PM, Rob Wultsch wult...@gmail.com 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


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: How to slim MySQL?

2010-07-06 Thread mos

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

At 09:59 AM 7/5/2010, you wrote:

Hi folks,
I'd like to install MySQL on an embedded system. It's a powerful x86-based
computer with the only limitation of having a small-size flash ROM as its
secondary storage.
I tried installing MySQL from source which resulted in occupying 140 MB of
disk space, while the maximum amount of flash memory I'm permitted to use is
about 20-30 MB. So I'm wondering how to go about slimming MySQL down to the
bare minimum. Following is the list of directories at the root of the
installation directory:
* bin/
* include/
* lib/
* libexec/
* mysql-test/
* share/
* sql-bench/

I think removing the 'include', 'mysql-test' and 'sql-bench' directories may
be a good start, but I'm still far away from having a tiny little mysql!

BTW, I tried MySQL Embedded, but it seems that it doesn't meet our needs.

Any help would be highly appreciated :)

*-- Nima Mohammadi*



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: How to slim MySQL?

2010-07-06 Thread Nima Mohammadi
On Tue, Jul 6, 2010 at 2:00 PM, Joerg Bruehe joerg.bru...@sun.com wrote:

 Hi!


 Nima Mohammadi wrote:
  On Mon, Jul 5, 2010 at 8:26 PM, Rob Wultsch wult...@gmail.com 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-06 Thread Nima Mohammadi
On Tue, Jul 6, 2010 at 7:10 PM, mos mo...@fastmail.fm 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 Andrés Tello
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.





On Tue, Jul 6, 2010 at 10:59 AM, Nima Mohammadi nima@gmail.com wrote:

 On Tue, Jul 6, 2010 at 7:10 PM, mos mo...@fastmail.fm wrote:
 Hope the scenario is clear now!
 Did you really need this explanation to answer my question?

 -- Nima Mohammadi



How to slim MySQL?

2010-07-05 Thread Nima
Hi folks,
I'd like to install MySQL on an embedded system. It's a powerful x86-based
computer with the only limitation of having a small-size flash ROM as its
secondary storage.
I tried installing MySQL from source which resulted in occupying 140 MB of
disk space, while the maximum amount of flash memory I'm permitted to use is
about 20-30 MB. So I'm wondering how to go about slimming MySQL down to the
bare minimum. Following is the list of directories at the root of the
installation directory:
* bin/
* include/
* lib/
* libexec/
* mysql-test/
* share/
* sql-bench/

I think removing the 'include', 'mysql-test' and 'sql-bench' directories may
be a good start, but I'm still far away from having a tiny little mysql!

BTW, I tried MySQL Embedded, but it seems that it doesn't meet our needs.

Any help would be highly appreciated :)

*-- Nima Mohammadi*


Re: How to slim MySQL?

2010-07-05 Thread Rob Wultsch
On Mon, Jul 5, 2010 at 7:59 AM, Nima nima@gmail.com wrote:
 Hi folks,
 I'd like to install MySQL on an embedded system. It's a powerful x86-based
 computer with the only limitation of having a small-size flash ROM as its
 secondary storage.
 I tried installing MySQL from source which resulted in occupying 140 MB of
 disk space, while the maximum amount of flash memory I'm permitted to use is
 about 20-30 MB. So I'm wondering how to go about slimming MySQL down to the
 bare minimum. Following is the list of directories at the root of the
 installation directory:
 * bin/
 * include/
 * lib/
 * libexec/
 * mysql-test/
 * share/
 * sql-bench/

 I think removing the 'include', 'mysql-test' and 'sql-bench' directories may
 be a good start, but I'm still far away from having a tiny little mysql!

 BTW, I tried MySQL Embedded, but it seems that it doesn't meet our needs.

 Any help would be highly appreciated :)

 *-- Nima Mohammadi*


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

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: How to slim MySQL?

2010-07-05 Thread Nima Mohammadi
On Mon, Jul 5, 2010 at 8:26 PM, Rob Wultsch wult...@gmail.com 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*


Re: How to slim MySQL?

2010-07-05 Thread Rob Wultsch
On Mon, Jul 5, 2010 at 10:07 AM, Nima Mohammadi nima@gmail.com wrote:
 On Mon, Jul 5, 2010 at 8:26 PM, Rob Wultsch wult...@gmail.com 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*


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

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: How to slim MySQL?

2010-07-05 Thread Nima Mohammadi
On Mon, Jul 5, 2010 at 10:11 PM, Rob Wultsch wult...@gmail.com 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 Michael Dykman
As you are building from source, whats pre-compile configuration
options are you using?  That will have everything to do with the size
of your resulting binaries.

 - michael dykman


On Mon, Jul 5, 2010 at 1:53 PM, Nima Mohammadi nima@gmail.com wrote:
 On Mon, Jul 5, 2010 at 10:11 PM, Rob Wultsch wult...@gmail.com 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*




-- 
 - michael dykman
 - mdyk...@gmail.com

 May the Source be with you.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: How to slim MySQL?

2010-07-05 Thread Michael Dykman
Go through that list of options and exclude anything you don't want or
need.  It is a very long list.

 - md

On Mon, Jul 5, 2010 at 4:39 PM, Nima Mohammadi nima@gmail.com wrote:

 On Tue, Jul 6, 2010 at 12:54 AM, Michael Dykman mdyk...@gmail.com wrote:

 As you are building from source, whats pre-compile configuration
 options are you using?  That will have everything to do with the size
 of your resulting binaries.

  - michael dykman


 ./configure --prefix=/home/nima/mysql/ --without-docs --without-debug
 --without-man --disable-ipv6 --disable-largefile


 -- Nima Mohammadi




-- 
 - michael dykman
 - mdyk...@gmail.com

 May the Source be with you.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org