Ad Widget

Collapse

Slow query issue | Zabbix 6.2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • galavichid
    Member
    • Mar 2021
    • 40

    #1

    Slow query issue | Zabbix 6.2

    Hi,

    I have install new Zabbix server + 1x Zabbix Proxy.
    The server is running for 2 weeks, and i have reach to the point the log creating "slow query", if I got it right, its related when the server is not powerful enough to get the information from DB.
    I guess this is why i am also having very slow reaction in the web-gui, and also miss some information in graphs.
    The server is running on Ubuntu Server 22 \ VM Machine \ 2VCPU \ 24 RAM.

    Any suggestion where is my bottle neck? do i need better server? The idea eventually is to monitor ~1500 different devices (agent\snmp)
    Thank you
    Click image for larger version

Name:	image.png
Views:	4518
Size:	16.8 KB
ID:	456875
  • Lerma
    Junior Member
    • Aug 2022
    • 7

    #2
    Hello

    I have a similar problem.

    Attached image and log

    tail -f /var/log/zabbix/zabbix_server.log
    2307:20230104:162728.568 slow query: 11.236022 sec, "insert into history_uint (itemid,clock,ns,value) values (44632,1672871236,929683644,2),(44628,1672871236,9 29683644,2),(70925,1672871236,929683644,2),(44603, 1672871236,929683644,1),(44607,1672871236,92968364 4,2),(71435,1672871236,929683644,2),(71434,1672871 236,929683644,2),(70771,1672871236,929683644,2),(4 4633,1672871236,929683644,2),(70927,1672871236,929 683644,2),(69462,1672871236,929683644,2),(44202,16 72871236,929683644,0),(69453,1672871236,929683644, 2),(70928,1672871236,929683644,1),(70775,167287123 6,929683644,1),(44614,1672871236,929683644,2),(446 31,1672871236,929683644,2),(44643,1672871236,92968 3644,2),(338448,1672871236,929683644,2),(44653,167 2871236,929683644,1),(338452,1672871236,929683644, 1),(44623,1672871236,929683644,2),(44646,167287123 6,929683644,1),(44634,1672871236,929683644,1),(694 61,1672871236,929683644,2),(71035,1672871236,92968 3644,2),(70924,1672871236,929683644,2),(71032,1672 871236,929683644,2),(69467,1672871236,929683644,1) ,(69458,1672871236,929683644,2),(44620,1672871236, 929683644,2),(338449,1672871236,929683644,2),(3384 44,1672871236,972086400,2),(44640,1672871236,97208 6400,2),(335903,1672871236,972086400,2),(44606,167 2871236,972086400,1),(69466,1672871236,972086400,1 ),(69464,1672871236,972086400,2),(44625,1672871236 ,972086400,2),(71502,1672871236,972086400,1),(4465 8,1672871236,972086400,1),(44469,1672871236,972086 400,0),(44654,1672871236,972086400,1),(44644,16728 71236,972086400,1),(44651,1672871236,972086400,1), (70923,1672871236,972086400,2),(44604,1672871236,9 72086400,1),(44652,1672871236,972086400,1),(334234 ,1672871236,972086400,2),(44608,1672871236,9720864 00,1),(44659,1672871236,972086400,1),(335905,16728 71236,972086400,1),(71443,1672871236,972086400,1), (69451,1672871236,972086400,2),(44664,1672871236,9 72086400,1),(44615,1672871236,972086400,2),(44639, 1672871236,972086400,2),(44611,1672871236,97208640 0,2),(44661,1672871236,972086400,1),(334237,167287 1236,972086400,2),(71031,1672871236,972086400,2),( 44635,1672871236,972086400,2),(44657,1672871236,97 2086400,1),(44642,1672871236,972086400,2),(44662,1 672871236,972086400,1),(44641,1672871236,972086400 ,2),(44660,1672871236,972086400,1),(69450,16728712 36,972086400,2),(70770,1672871236,972086400,2),(71 444,1672871236,972086400,1),(338446,1672871236,972 086400,2),(44636,1672871236,972086400,1),(44621,16 72871236,972086400,2),(44630,1672871236,972086400, 2),(44668,1672871236,972086400,1),(338447,16728712 36,972086400,2),(71499,1672871236,972086400,2),(33 4239,1672871236,972086400,1),(44637,1672871236,972 086400,1),(44468,1672871236,972086400,0),(44663,16 72871237,8029042,1),(335901,1672871237,8029042,2), (44629,1672871237,8029042,1),(334236,1672871237,80 29042,2),(70926,1672871237,8029042,2),(44609,16728 71237,8029042,2),(334238,1672871237,8029042,2),(71 500,1672871237,8029042,2),(338445,1672871237,80290 42,2),(71501,1672871237,8029042,2),(44667,16728712 37,8029042,1),(71036,1672871237,8029042,1),(69463, 1672871237,8029042,2),(44656,1672871237,8029042,1) ,(44602,1672871237,8029042,1),(338453,1672871237,8 029042,1),(71503,1672871237,8029042,2),(69460,1672 871237,8029042,2),(44470,1672871237,8029042,0),(44 134,1672871237,67197730,0),(44200,1672871237,67197 730,0),(44133,1672871237,67197730,0),(69456,167287 1237,67197730,2),(335904,1672871237,67197730,2),(4 8437,1672871237,67876268,1),(44665,1672871237,1357 89345,1),(338451,1672871237,135789345,2),(335902,1 672871237,187933425,2),(69465,1672871237,187933425 ,1),(338441,1672871237,187933425,2),(44626,1672871 237,187933425,2),(69455,1672871237,187933425,2),(4 4605,1672871237,187933425,1),(338443,1672871237,18 7933425,2),(44622,1672871237,187933425,2),(44610,1 672871237,187933425,2),(70774,1672871237,187933425 ,2),(71440,1672871237,187933425,2),(71437,16728712 37,187933425,2),(334235,1672871237,187933425,2),(4 4647,1672871237,187933425,1),(44619,1672871237,187 933425,2),(71034,1672871237,187933425,2),(71441,16 72871237,187933425,2),(338450,1672871237,187933425 ,2),(44649,1672871237,187933425,1),(44617,16728712 37,187933425,2),(71438,1672871237,187933425,2),(71 439,1672871237,187933425,2),(69454,1672871237,1879 33425,2);
    "
    2312:20230104:162731.131 slow query: 12.782226 sec, "insert into history_uint (itemid,clock,ns,value) values (48155,1672871238,165799249,1),(48076,1672871238,1 65799249,1),(48161,1672871238,165799249,2),(47020, 1672871238,165799249,0),(48138,1672871238,16579924 9,2),(48178,1672871238,165799249,2),(48249,1672871 238,165799249,2),(48107,1672871238,165799249,1),(4 8085,1672871238,165799249,1),(48201,1672871238,165 799249,2),(48185,1672871238,165799249,2),(48156,16 72871238,165799249,2),(48238,1672871238,165799249, 1),(48078,1672871238,165799249,2),(48122,167287123 8,165799249,2),(48109,1672871238,165799249,1),(481 00,1672871238,165799249,2),(48189,1672871238,16579 9249,2),(48171,1672871238,165799249,2),(48157,1672 871238,165799249,2),(48125,1672871238,243952560,2) ,(48103,1672871238,243952560,2),(48146,1672871238, 243952560,2),(48145,1672871238,243952560,2),(48244 ,1672871238,243952560,1),(48210,1672871238,2439525 60,2),(48143,1672871238,243952560,1),(48089,167287 1238,243952560,2),(48084,1672871238,243952560,2),( 48104,1672871238,243952560,1),(48245,1672871238,24 3952560,1),(48239,1672871238,243952560,1),(48168,1 672871238,243952560,2),(48234,1672871238,243952560 ,1),(48081,1672871238,243952560,1),(48177,16728712 38,243952560,2),(48162,1672871238,243952560,2),(48 213,1672871238,243952560,1),(48108,1672871238,2439 52560,2),(48188,1672871238,243952560,2),(48192,167 2871238,243952560,2),(48199,1672871238,243952560,2 ),(47195,1672871238,243952560,0),(48195,1672871238 ,243952560,2),(48134,1672871238,243952560,1),(4813 3,1672871238,243952560,1),(48082,1672871238,243952 560,2),(48198,1672871238,243952560,1),(48135,16728 71238,243952560,2),(69753,1672871238,243952560,1), (48142,1672871238,243952560,1),(48113,1672871238,2 43952560,1),(48141,1672871238,243952560,2),(48130, 1672871238,243952560,1),(48080,1672871238,24395256 0,2),(48077,1672871238,243952560,1),(48167,1672871 238,243952560,2),(48095,1672871238,243952560,2),(4 8208,1672871238,243952560,2),(48247,1672871238,243 952560,1),(48116,1672871238,243952560,2),(48246,16 72871238,243952560,1),(48144,1672871238,292173723, 1),(48212,1672871238,292173723,1),(48183,167287123 8,292173723,2),(48236,1672871238,292173723,1),(480 93,1672871238,292173723,1),(48160,1672871238,29217 3723,2),(48206,1672871238,292173723,2),(48150,1672 871238,292173723,1),(48158,1672871238,292173723,2) ,(48083,1672871238,292173723,2),(46843,1672871238, 292173723,0),(48159,1672871238,292173723,2),(48117 ,1672871238,292173723,2),(48166,1672871238,2921737 23,2),(48204,1672871238,292173723,2),(48127,167287 1238,292173723,1),(48131,1672871238,292173723,1),( 48182,1672871238,292173723,2),(48174,1672871238,29 2173723,1),(48163,1672871238,292173723,2),(48112,1 672871238,292173723,1),(48223,1672871238,292173723 ,1),(48132,1672871238,292173723,2),(69758,16728712 38,292173723,1),(48215,1672871238,292173723,1),(48 119,1672871238,292173723,2),(48128,1672871238,2921 73723,1),(48205,1672871238,292173723,1),(48121,167 2871238,292173723,2),(48079,1672871238,292173723,2 ),(48227,1672871238,292173723,1),(48193,1672871238 ,292173723,2),(48243,1672871238,292173723,2),(4811 4,1672871238,292173723,2),(48098,1672871238,292173 723,2),(48211,1672871238,292173723,2),(48228,16728 71238,292173723,1),(48190,1672871238,292173723,1), (48094,1672871238,292173723,1),(48105,1672871238,2 92173723,2),(48086,1672871238,292173723,1),(48097, 1672871238,292173723,2),(48209,1672871238,29217372 3,1),(48181,1672871238,292173723,2),(48099,1672871 238,292173723,2),(48088,1672871238,292173723,2),(4 8186,1672871238,292173723,1),(48118,1672871238,292 173723,1),(48136,1672871238,292173723,2),(48172,16 72871238,292173723,2),(48232,1672871238,292173723, 1),(48229,1672871238,292173723,1),(69756,167287123 8,292173723,2),(48194,1672871238,292173723,2),(697 55,1672871238,292173723,2),(48179,1672871238,29217 3723,2),(48237,1672871238,292173723,1),(48140,1672 871238,292173723,2),(48226,1672871238,292173723,2) ,(48120,1672871238,292173723,2),(48200,1672871238, 292173723,2),(48148,1672871238,292173723,2),(48092 ,1672871238,292173723,2),(48216,1672871238,2921737 23,1),(48217,1672871238,292173723,1),(48129,167287 1238,292173723,1),(48102,1672871238,292173723,2),( 48197,1672871238,292173723,2),(48222,1672871238,29 2173723,1),(48090,1672871238,292173723,2),(69757,1 672871238,292173723,1),(48096,1672871238,292173723 ,1),(48075,1672871238,292173723,1),(48242,16728712 38,292173723,1),(46844,1672871238,321290709,0);
    "
    2307:20230104:162732.363 slow query: 3.634870 sec, "insert into history_uint (itemid,clock,ns,value) values (44268,1672871236,972086400,0),(44267,1672871237,6 7197730,0),(44401,1672871237,67197730,0),(44403,16 72871237,135789345,0),(66072,1672871241,702432907, 2),(65063,1672871241,702432907,2),(65894,167287124 1,702432907,2),(66372,1672871241,702432907,2),(708 72,1672871241,702432907,2),(66680,1672871241,70243 2907,1),(66110,1672871241,702432907,2),(65916,1672 871241,702432907,2),(66377,1672871241,702432907,2) ,(65509,1672871241,702432907,2),(66590,1672871241, 702432907,2),(65657,1672871241,702432907,2),(65921 ,1672871241,702432907,2),(66225,1672871241,7439201 46,2),(64864,1672871241,743920146,2),(57995,167287 1241,743920146,0),(66694,1672871241,743920146,1),( 66564,1672871241,743920146,2),(65966,1672871241,74 3920146,2),(64795,1672871241,743920146,2),(65812,1 672871241,743920146,2),(66656,1672871241,743920146 ,1),(66818,1672871241,743920146,1),(66537,16728712 41,743920146,2),(66690,1672871241,743920146,1),(65 946,1672871241,743920146,2),(66614,1672871241,7439 20146,2),(71247,1672871241,743920146,2),(66021,167 2871241,743920146,2),(66040,1672871241,743920146,1 ),(66046,1672871241,743920146,2),(65618,1672871241 ,743920146,2),(65640,1672871241,743920146,2),(6501 7,1672871241,743920146,1),(65971,1672871241,743920 146,2),(66657,1672871241,743920146,1),(65997,16728 71241,743920146,2),(65816,1672871241,743920146,2), (64971,1672871241,743920146,2),(66376,1672871241,7 43920146,2),(64947,1672871241,743920146,2),(65329, 1672871241,743920146,1),(66835,1672871241,74392014 6,1),(66232,1672871241,781484515,2),(65636,1672871 241,781484515,2),(65396,1672871241,827605772,2),(6 7017,1672871241,827605772,1),(65346,1672871241,827 605772,2),(65985,1672871241,827605772,2),(66026,16 72871241,827605772,2),(66006,1672871241,827605772, 2),(66013,1672871241,827605772,1),(66873,167287124 1,827605772,1),(66452,1672871241,827605772,2),(661 77,1672871241,827605772,2),(65265,1672871241,82760 5772,2),(65857,1672871241,827605772,1),(66972,1672 871241,827605772,1),(65909,1672871241,827605772,2) ,(65297,1672871241,827605772,2),(65475,1672871241, 827605772,2),(64926,1672871241,827605772,2),(64854 ,1672871241,827605772,2),(66087,1672871241,8276057 72,2),(66389,1672871241,827605772,2),(65029,167287 1241,827605772,2),(70873,1672871241,827605772,2),( 66991,1672871241,827605772,1),(66284,1672871241,82 7605772,1),(65598,1672871241,827605772,2),(64911,1 672871241,827605772,2),(66877,1672871241,827605772 ,1),(67013,1672871241,827605772,1),(65888,16728712 41,827605772,2),(66908,1672871241,827605772,1),(71 220,1672871241,827605772,2),(66546,1672871241,8276 05772,1),(67011,1672871241,827605772,1),(66853,167 2871241,827605772,2),(66508,1672871241,827605772,2 ),(64929,1672871241,827605772,2),(64788,1672871241 ,827605772,2),(66899,1672871241,827605772,1),(6678 3,1672871241,827605772,1),(64875,1672871241,827605 772,2),(66502,1672871241,827605772,2),(65840,16728 71241,827605772,2),(66316,1672871241,827605772,1), (64883,1672871241,827605772,2),(66342,1672871241,8 27605772,1),(65453,1672871241,827605772,2),(70637, 1672871241,827605772,2),(66486,1672871241,82760577 2,2),(65525,1672871241,827605772,1),(65850,1672871 241,827605772,2),(65393,1672871241,827605772,2),(6 5127,1672871241,827605772,2),(66611,1672871241,827 605772,2),(64951,1672871241,827605772,2),(66261,16 72871241,878455651,2),(66141,1672871241,878455651, 2),(65843,1672871241,878455651,2),(66712,167287124 1,878455651,1),(64816,1672871241,878455651,1),(669 93,1672871241,878455651,1),(65928,1672871241,87845 5651,2),(65713,1672871241,878455651,2),(66817,1672 871241,878455651,1),(65808,1672871241,878455651,2) ,(66697,1672871241,878455651,1),(64858,1672871241, 878455651,2),(65941,1672871241,878455651,2),(66859 ,1672871241,878455651,1),(66762,1672871241,8784556 51,2),(66673,1672871241,878455651,1),(66106,167287 1241,878455651,2),(65011,1672871241,878455651,2),( 65942,1672871241,878455651,2),(66534,1672871241,87 8455651,2),(65833,1672871241,878455651,2),(71166,1 672871241,878455651,2),(65615,1672871241,878455651 ,2),(65094,1672871241,878455651,2),(66940,16728712 41,878455651,1),(66526,1672871241,878455651,1),(33 7626,1672871241,878455651,2),(65819,1672871241,878 455651,2),(65086,1672871241,878455651,2),(65207,16 72871241,878455651,2),(65405,1672871241,878455651, 1),(71112,1672871241,878455651,1),(66631,167287124 1,878455651,2),(70673,1672871241,878455651,1),(670 20,1672871241,878455651,1),(65190,1672871241,87845 5651,2),(66975,1672871241,878455651,1),(65138,1672 871241,878455651,2),(66185,1672871241,878455651,2) ,(66282,1672871241,878455651,1),(65735,1672871241, 878455651,2),(70639,1672871241,878455651,2),(66705 ,1672871241,878455651,1),(66266,1672871241,8784556 51,2),(65706,1672871241,878455651,2),(65676,167287 1241,878455651,2),(66957,1672871241,878455651,2),( 337633,1672871241,878455651,2),(65556,1672871241,8 78455651,2),(66961,1672871241,878455651,2),(67031, 1672871241,878455651,1),(64792,1672871241,87845565 1,2),(66423,1672871241,878455651,1),(65938,1672871 241,878455651,2),(65351,1672871241,878455651,1),(6 6905,1672871241,878455651,1),(65972,1672871241,878 455651,2),(65624,1672871241,878455651,2),(66598,16 72871241,878455651,1),(66645,1672871241,878455651, 2),(70870,1672871241,878455651,2),(65580,167287124 1,878455651,2),(65164,1672871241,878455651,1),(670 23,1672871241,878455651,1),(65380,1672871241,87845 5651,2),(66517,1672871241,878455651,2),(64985,1672 871241,878455651,2),(64991,1672871241,878455651,1) ,(66076,1672871241,878455651,2),(66002,1672871241, 912157476,2),(64921,1672871241,912157476,2),(65444 ,1672871241,912157476,2),(66741,1672871241,9465428 06,1);
    "​​
    Attached Files

    Comment

    • Hamardaban
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • May 2019
      • 2713

      #3
      The solution is fast SSDs for the database + database optimization + transition to partitioning.

      Comment


      • Lerma
        Lerma commented
        Editing a comment
        ok
        Some information for this? Hamardaba do you have it?
    • galavichid
      Member
      • Mar 2021
      • 40

      #4
      Lerma how many hosts/triggers/items you monitor? What are the specs of your machine?

      i have made big change and remove from discovery the “services discovery” and deleted all these items, then run a housekeeping to clean it all and it’s running much faster now.
      it’s just a work around for now till I get it set with dedicated server in production.

      i guess as Hamardaban says, must use a good server and configure it right.

      thank you

      Comment


      • Lerma
        Lerma commented
        Editing a comment
        Hello

        5 hosts have monitoring

        Could you tell me if you used some of the steps you mention?

      • galavichid
        galavichid commented
        Editing a comment
        Lerma I had like 140 hosts when i got the issue. but with 5 that to less i would think.

        what are the specs of your zabbix server?
    • Lerma
      Junior Member
      • Aug 2022
      • 7

      #5
      galavichid CPU Core i3. 2.90 GHZ, RAM 8GB, 64 bits
      OS: CENTOS 9,

      When I click on the hosts option in the DASHBOARD tab, Front End becomes slow until Gateway timeOut appears

      Comment


      • galavichid
        galavichid commented
        Editing a comment
        Try to monitor the computer your running the server on, if its performance issue
        my knowledge is limited unfortunately, but that what i can think of

        good luck
    Working...