473,765 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mysql database latent size problems

Hi,

We tried 2 techniques to mesure db size and both fails to return
realtime size.

a) under innodb, we ’show variables’, find the innodb_data_fil e_path
variable and parse the size (works only if not autoextend) and we
substract the ’InnoDB free: ??? kB’ from the Comment field of ’show
table status’.

b) for all monitored tables, we figure:
indexFree = indexLength/dataLength * dataFree
and we sum up:
dataLength-dataFree + indexLength-indexFree
In both case the size is fair, although not perfectly equal (method A
reports bigger size), but the growth is comparable.

The problem lies in the accuracy of that info. We do bulky deletes,
removing 10 to 40% of rows in many tables.

First bug, the size of the DB is not quickly following the ’delete’
statements (it may decay for 20-40 minutes after the statements
completed!!).

Second bug, the DB size is not changing for 1-2 hours even though we
inserts a lot.

(We are talking about a few 10 millions rows tables in a 40 gigs
InnoDB space, getting ~500 inserts/s, ~2000-5000 deletes/s)

How can one mesure the DB size more in real-time, and avoid/account
the latent period where growth seams abscent?

--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/mySQL-databa...ict216402.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=741880
Jul 23 '05 #1
5 2132
"quartz12h" wrote:
Hi,

We tried 2 techniques to mesure db size and both fails to
return realtime size.

a) under innodb, we 'show variables', find the
innodb_data_fil e_path variable and parse the size (works only
if not autoextend) and we substract the 'InnoDB free: ??? kB'
from the Comment field of 'show table status'.

b) for all monitored tables, we figure:
indexFree = indexLength/dataLength * dataFree
and we sum up:
dataLength-dataFree + indexLength-indexFree
In both case the size is fair, although not perfectly equal
(method A reports bigger size), but the growth is comparable.

The problem lies in the accuracy of that info. We do bulky
deletes, removing 10 to 40% of rows in many tables.

First bug, the size of the DB is not quickly following the
'delete' statements (it may decay for 20-40 minutes after the
statements completed!!).

Second bug, the DB size is not changing for 1-2 hours even
though we inserts a lot.

(We are talking about a few 10 millions rows tables in a 40
gigs InnoDB space, getting ~500 inserts/s, ~2000-5000
deletes/s)

How can one mesure the DB size more in real-time, and
avoid/account the latent period where growth seams abscent?


Besides the above, why not directly parse the data from the data
directory? With the db like that, I am sure you have root access, and
can set up read access to the mysql data directory.
Jul 23 '05 #2
"steve" wrote:
Besides the above, why not directly parse the data from the
data directory? With the db like that, I am sure you have
root access, and can set up read access to the mysql data
directory.


because it is an InnoDB file, a private virtual file system of fixed
size view from the OS filesystem
Jul 23 '05 #3
quartz12h wrote:
First bug, the size of the DB is not quickly following the ’delete’
statements (it may decay for 20-40 minutes after the statements
completed!!).

Second bug, the DB size is not changing for 1-2 hours even though we
inserts a lot.


I believe this is as designed.

Deleting records from a database file doesn't actually shrink the file,
instead it marks the space occupied by the deleted records as available.
This is a better way than shrinking the file following a delete.
Because in a large database, this is quicker than compacting the data to
a shorter contiguous file, which might take many minutes. You probably
don't want that extra time to be used when you execute a DELETE.

New records are inserted into the available space within the file, as
long as it fits. The database file is increased in size only when the
available space is exhausted by new data (although there might be some
small gaps left over, for instance if the gap is smaller than any newly
inserted record).

Regards,
Bill K.
Jul 23 '05 #4
"steve" wrote:
Besides the above, why not directly parse the data from the
data directory? With the db like that, I am sure you have
root access, and can set up read access to the mysql data
directory.


and even if it was myisam, that would not account for non-optimized
tables that have unused freespaces in those files.
Jul 23 '05 #5
"quartz12h" wrote:
Hi,

We tried 2 techniques to mesure db size and both fails to
return realtime size.

a) under innodb, we 'show variables', find the
innodb_data_fil e_path variable and parse the size (works only
if not autoextend) and we substract the 'InnoDB free: ??? kB'
from the Comment field of 'show table status'.

b) for all monitored tables, we figure:
indexFree = indexLength/dataLength * dataFree
and we sum up:
dataLength-dataFree + indexLength-indexFree
In both case the size is fair, although not perfectly equal
(method A reports bigger size), but the growth is comparable.

The problem lies in the accuracy of that info. We do bulky
deletes, removing 10 to 40% of rows in many tables.

First bug, the size of the DB is not quickly following the
'delete' statements (it may decay for 20-40 minutes after the
statements completed!!).

Second bug, the DB size is not changing for 1-2 hours even
though we inserts a lot.

(We are talking about a few 10 millions rows tables in a 40
gigs InnoDB space, getting ~500 inserts/s, ~2000-5000
deletes/s)

How can one mesure the DB size more in real-time, and
avoid/account the latent period where growth seams abscent?


We were told that there ’deletes’ are performed in background long
after the delete statement is finished.

Where should we look for mesuring that space about to be freed
(deletes in progress)?

What should we look for to detect that the background delete jobs are
finished?

Where can we find the space in freed ’B-tree pages’?

mysql bug #10074
http://bugs.mysql.com/bug.php?id=10074
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3527
by: Lenz Grimmer | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, MySQL 4.0.14, a new version of the popular Open Source/Free Software Database, has been released. It is now available in source and binary form for a number of platforms from our download pages at http://www.mysql.com/downloads/ and mirror sites.
2
1602
by: Jeffrey D Moncrieff | last post by:
I am trying to create a data base for colleting date for my research project. I have run in to a couple of problems and I need it fast ASAP I need it to be able to add data and edit them and view the data form a public site. I have not use mysql and php since 2003 I have created the date base with 2 tables 1 for a Jump Menu and on for the content. The contents is in a table called PR and I as soon as I enter the data and hit submit the web...
1
3379
by: jlee | last post by:
I'm pretty much a newbie on mysql, and I need some help. I am running mysql Ver 12.22 Distrib 4.0.24, for portbld-freebsd5.4 (i386) on a server hosting an active website. The site's developer uses his own php shopping cart to receive customer orders. The configuration was done via cPanel with no external modifications - which produced no protests when built, ran and connected with no
1
2829
by: Good Man | last post by:
Hi there I've noticed some very weird things happening with my current MySQL setup on my XP Laptop, a development machine. For a while, I have been trying to get the MySQL cache to work. Despite entering the required lines to "my.ini" (the new my.cnf) through notepad AND MySQL Administrator, the cache does not work. So, today I took a peek at the 'Health' tab in MySQL Administrator.
15
4641
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
13
2311
by: Jim Hubbard | last post by:
I have a client that desires a new application for use at several stores in different cities. He wants "real time" access to all store data and the ability to continue to run locally even if the internet connection goes down. It occurs to me that a local MySQL instance should definitely be in each store to continue work if the net is down for any reason. But, what is the best way to synchronize/share data among all of the stores? ...
110
10625
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst case scenario for MyISAM backend? Also is it possible to not to lose data but get them corrupted?
8
3880
by: The Natural Philosopher | last post by:
This is so weird. What I am trying to do is to upload files and stuff them in a mysql database. Everything works except the file content is zero. using the load_file command from mysql command line as 'root' works and i can download the inserted file ok.
221
367718
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application needs to store entire files, the preferred method is to save the file onto the server’s file-system, and store the physical location of the file in your database. This is generally considered to be the easiest and fastest way to store files. ...
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.