If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Not sure if the former version worked in some older version of MySQL though.
Is there someone who can merge this somewhere in the wiki, or should I create an account for editing the wiki and do it myself?

Finally, at 1.5.2 we need to do a SELECT on several tables to find the oldest date so we know which partitions must be made, and create SQL from that.
I've made a script that automatically generates the SQL for the supplied tables that is needed for initializing MySQL partitioning, and I would like to share it for review, maybe even for inclusion in the wiki.
Can I paste the script here and get feedback and/or corrections, or is another forum more appropriate?

basically that statement makes virtually impossible this table to be partitioned

also this statement severely impair the performance of the zabbix itself, first because such a index can not be cached second because the column key_ contents expressions which in some occasions can be very long and all this is used as a index .....

guys, with all my respect, i like zabbix very much, but you still have a lot a job to do on the MySQL schema design, rather than to think how to close our thread

Comment

[..]
basically that statement makes virtually impossible this table to be partitioned

So far no one needs to partition items table.
Content of the items table is constantly present in zabbix server configuration cache and this table needs to be updated only when list of the monitored items needs to be updated.

Comment

So far no one needs to partition items table.
Content of the items table is constantly present in zabbix server configuration cache and this table needs to be updated only when list of the monitored items needs to be updated.

i have to disagree with you again

1) table items may have hundreds of thousands and even millions records
2) unique indexes can not be cached
3) rendering pages like Monitoring-> triggers, Monitoring-> latest data, Monitoring->overview, actively use items table

and this is just on the front-end, on the back-end (data from zabbix server) the situation is even worse, cuz items table has so many constrains and cascade delete constrains, so as like i said this table has been used virtually by each and every query and it is updated very often as well - every time you modify a hosts or the templates assigned to the hosts

so, long story short - my items table has 4 millions records and its size is close to 2G, and i desperately need to partition it

just one single host may have up to 300-500 items - monitoring the linux OS, hard drives and network shares and IPMI controller for example and you already have 500 items for one single host in the items table
if you monitor 2-3000 instances plus 5-10 applications on each instance and you easily can have few millions records on items table ... and your zabbix server will be nearly dead

Comment

I don't think that it will be any issue with HASH partitions using itemid column and it is only type of the partitions which I see which could be added on items table.

Just one single host may have up to 300-500 items - monitoring the linux OS, hard drives and network shares and IPMI controller for example and you already have 500 items for one single host in the items table if you monitor 2-3000 instances plus 5-10 applications on each instance and you easily can have few millions records on items table ... and your zabbix server will be nearly dead

Again: zabbix server on processing incoming data is doing this against data held inn zabbix server memory. This processing would be very slow if it will be necessary to do this constantly querying soe some items table data.
Only bits which could improve partitioning items table is moment when new items needs to be added/deleted/enabled/disabled or just after zabbix server start when zabbix server configuration cache is filled using items and other tables content.

So question is: do you have any problems with latency of those operations or not?
If not you are digging i wrong place and instead starting from sentence that it is not possible to partition items table you should describe your issues.

Comment

I don't think that it will be any issue with HASH partitions using itemid column and it is only type of the partitions which I see which could be added on items table.
.

well, it is an issue in fact
in order to be able to partition any table in MySQL, you need:

1) the table must not refereed by any other tables
2) the table must not have constrains
3) all columns you use as key for partitioning must be included in all unique keys and primary indexes

so we have hostid and key_ in unique index and itemid in primary key
so you either you need to add hostid into primary key , either you must add itemid into unique index
both ways will lead you to compromising the data
but even if you do this you have to remove all referrers from each and every table which has a constrain with items table and it makes 11 tables to be precise

presently i try to remove the UNIQUE KEY `items_1` (`hostid`,`key_`)
the check if combination hostid and key_ is unique can be done from the code
the key_ column contains large strings and it must not be indexed - the index gets very big and slows down all operations related to table items

yes, i am 100% sure the issue i have - large latency on the web interface when you try to Monitoring-> triggers, Monitoring-> latest data, Monitoring->overview dues to items table
these pages do auto-refresh and in fact it makes them not usable
consecutively it overloads the DB and the server (php processes hang up up to the timeout)

Comment

Please .. I've not been asking about what is the cause of the issue which you are dealing with.
Please describe you issue describing of what you are observing.
Please as well separate raw observations from your understanding and conclusions.

So as Romans says "ab ovo" .. please start from the beginning (Latin "ab ovo" means "from the egg" .. as philosophers at Roma time come to conclusion that egg was before chicken ):
- what are you observing?
- what are you DB settings? At least: tx_isolation, innodb_buffer_pool_size but probaly best would be good to have at least all settings with non default values
- on what kind of hardware everything is working?
- what kind OS you are using?
- any IO stats will be extremely helpful (it does't need to be in from of graphs but at least in form of avg rates of read and write IOs).
- I know that already you are using MySQL. It would good to know which one version exactly you are using.

Comment

only the very small companies and single users host their databases on one single server

Sorry but I don't see such correlation.
More likely not using HA i result lack of experience people architecting exact stack and this may happen in any company size.

I am using a galera cluster and many other people are using multi-disks dataspaces

So you've choose way of implementing HA which by definition has biggest possible penalty on write operations ..
Do you know that it is not only way of have enough HA level in zabbix stack and native zabbix stack architecture has quite high HA build-in?
Do you know that biggest set of obstacles on on building really high performance zabbix server DB backend are related to provide not high read DB operations but in provide high level inserts/update queries speed .. however to pass those obstacles you must first guarantee really low latency red IO operations?

what i am trying to say is that zabbix's schema is lacking enterprise capabilities one of which is partitioning - it is virtually impossible to partition most of the tables in Zabbix's schema

Because .. ? Where are argument supporting such thesis? (these are only rhetorical question)

It seems to me Zabbix team prefer to stay with the small companies and single user rather than to create a product which can be used in an enterprise and distributed architectures

You must known that zabbix already has been tested beyond the scale which you have reached.

It is really hard to make any real comments without looking with what kind of problems you are dealing over answers on the questions which I've gave you.
Dispute it is type of the conversation in which people are using facts and contr facts.
Without those facts it is only and just normal conversation.