1 00:00:00,060 --> 00:00:05,730 ‫So what is the largest sequel query that we can send to this server? 2 00:00:06,390 --> 00:00:08,070 ‫Let's find out in this video. 3 00:00:08,220 --> 00:00:16,170 ‫All right, guys, so this video, I want to know what is the largest sequel that we can send before 4 00:00:16,170 --> 00:00:20,850 ‫the database server actually stays there and dies? 5 00:00:20,960 --> 00:00:24,180 ‫OK, this is what we're going to find on this video. 6 00:00:24,190 --> 00:00:34,050 ‫I'm going to I'm going to basically form a sequel that basically have an idea in equal one or it's equal 7 00:00:34,050 --> 00:00:36,870 ‫to or until it gives up. 8 00:00:36,880 --> 00:00:42,090 ‫So I'm going to try multiple times until we get an answer from the server and I'm going then I'm going 9 00:00:42,090 --> 00:00:44,850 ‫to look at Wireshark and convert that into. 10 00:00:44,850 --> 00:00:50,190 ‫How many TCP segment did we assemble in order to send that query? 11 00:00:50,360 --> 00:00:54,750 ‫OK, so let's go ahead and just send a normal query here. 12 00:00:54,750 --> 00:01:02,940 ‫I have no Jass and my databases posts gress and I'm using elephants equal as a service on the backend. 13 00:01:03,240 --> 00:01:04,920 ‫So we're going to do this. 14 00:01:04,920 --> 00:01:06,320 ‫And simple query. 15 00:01:06,630 --> 00:01:08,170 ‫This is the table right now. 16 00:01:08,670 --> 00:01:09,510 ‫Nothing fancy. 17 00:01:09,510 --> 00:01:14,520 ‫Have you query if you rows and this is this is the Warshak. 18 00:01:15,180 --> 00:01:22,650 ‫We did a set very, very similar video on them on this channel showing Warshak and Posterous and what 19 00:01:22,650 --> 00:01:23,760 ‫happens exactly. 20 00:01:24,160 --> 00:01:26,410 ‫This is the syndication part and this is the queue. 21 00:01:26,430 --> 00:01:30,720 ‫This is a query and this is the very simple query. 22 00:01:31,680 --> 00:01:35,280 ‫I took one Tsipi packet to send the square. 23 00:01:35,760 --> 00:01:38,730 ‫I'm going to go ahead and clear that thing and. 24 00:01:40,160 --> 00:01:48,080 ‫Right, a little bit of code and we're going to do we're close where I'd equal one and then just do 25 00:01:48,080 --> 00:01:53,450 ‫a simple loop that I equal zero eyes, less than one hundred plus plus. 26 00:01:53,720 --> 00:02:02,840 ‫And then we're going to do where equal or plus equal value to it or I'd equal. 27 00:02:03,780 --> 00:02:05,860 ‫I keep forgetting the text. 28 00:02:06,120 --> 00:02:06,650 ‫There you go. 29 00:02:07,690 --> 00:02:15,760 ‫I said, so this will basically this is the initial value and we're going to keep I just appending to 30 00:02:15,760 --> 00:02:17,590 ‫the workless and finally going to do this. 31 00:02:18,280 --> 00:02:21,370 ‫This is where obviously we have to where I'd equal this. 32 00:02:21,890 --> 00:02:22,360 ‫I was good. 33 00:02:23,700 --> 00:02:29,140 ‫And Knackery, this has and let's actually print that query so we can see how. 34 00:02:30,660 --> 00:02:36,910 ‫Console log, sequel to it, boom, right? 35 00:02:37,320 --> 00:02:37,870 ‫That's not bad. 36 00:02:38,580 --> 00:02:41,130 ‫Let's clear this and send it again. 37 00:02:41,790 --> 00:02:42,420 ‫Boom. 38 00:02:43,350 --> 00:02:51,750 ‫What we did, we got a cue and we have assembled still one one DCP Beckett, I'm all right. 39 00:02:52,200 --> 00:02:56,700 ‫It's a thousand bytes, almost one kilobyte. 40 00:02:57,090 --> 00:02:57,540 ‫All right. 41 00:02:57,720 --> 00:02:59,750 ‫Let's increase that to a thousand. 42 00:02:59,800 --> 00:03:00,920 ‫Let's see what will happen. 43 00:03:01,050 --> 00:03:02,760 ‫Save and spend. 44 00:03:03,340 --> 00:03:03,750 ‫Oh. 45 00:03:03,850 --> 00:03:04,800 ‫Oh. 46 00:03:07,060 --> 00:03:15,490 ‫All right, let's do this again and send a thousand with a thousand elements of our query. 47 00:03:18,080 --> 00:03:22,730 ‫Has nine assembled Tsipi segments? 48 00:03:23,210 --> 00:03:23,750 ‫All right. 49 00:03:23,930 --> 00:03:30,770 ‫OK, nine Tsipi segments, and obviously the more Tsipi segment, the more action you're going to receive 50 00:03:30,770 --> 00:03:36,770 ‫from the server and you have to assemble to pack all the stuff like that. 51 00:03:36,960 --> 00:03:39,880 ‫It's I bet you these are not in order at all. 52 00:03:39,890 --> 00:03:40,400 ‫Look at that. 53 00:03:41,330 --> 00:03:43,760 ‫This is obviously an accumulation of all of them. 54 00:03:43,780 --> 00:03:46,520 ‫So still, we didn't get an error with thousand. 55 00:03:46,520 --> 00:03:47,600 ‫How about ten thousand? 56 00:03:48,110 --> 00:03:49,270 ‫Astarte Ten thousand. 57 00:03:49,910 --> 00:03:52,310 ‫And let's clear Wireshark. 58 00:03:53,240 --> 00:03:54,030 ‫And then do it again. 59 00:03:54,190 --> 00:03:58,380 ‫Boom, oh, 10000 inquiry actually succeeds. 60 00:03:58,870 --> 00:03:59,500 ‫Wow. 61 00:04:00,120 --> 00:04:00,820 ‫All right. 62 00:04:01,160 --> 00:04:03,110 ‫So you can send. 63 00:04:03,900 --> 00:04:09,310 ‫And how about we actually print the length and bites, right? 64 00:04:09,470 --> 00:04:10,190 ‫How do you do that? 65 00:04:10,220 --> 00:04:11,220 ‫That the length? 66 00:04:12,210 --> 00:04:18,300 ‫All right, so for simplicity, I'm going to divide this into one thousand twenty four so we can get 67 00:04:18,300 --> 00:04:24,720 ‫into them and let's show that in kilobytes because we. 68 00:04:26,830 --> 00:04:28,300 ‫CaBi, right? 69 00:04:30,270 --> 00:04:37,250 ‫I guess I could have done that online, but sure, look at that one twenty five kilobyte, right. 70 00:04:37,710 --> 00:04:40,290 ‫Let's see how this looks like an wireshark. 71 00:04:40,320 --> 00:04:41,070 ‫Do it again. 72 00:04:41,370 --> 00:04:44,880 ‫One twenty five kilobyte, one security. 73 00:04:45,060 --> 00:04:45,870 ‫Oh, my God. 74 00:04:45,870 --> 00:04:47,670 ‫Look at all these retransmissions. 75 00:04:48,150 --> 00:04:52,000 ‫I this is I don't I can't even find the quake. 76 00:04:52,000 --> 00:04:53,760 ‫And you guys, I can't find the query. 77 00:04:54,360 --> 00:04:55,110 ‫Where's the query. 78 00:04:57,350 --> 00:04:58,110 ‫There you go. 79 00:04:58,160 --> 00:04:59,330 ‫It took me a while to find the. 80 00:05:00,140 --> 00:05:04,370 ‫It's 90 assembled TCP segment. 81 00:05:05,000 --> 00:05:09,890 ‫It doesn't tell me the total length, but we know the total length as well as on, what, one twenty 82 00:05:10,130 --> 00:05:11,360 ‫five kilobyte. 83 00:05:11,930 --> 00:05:15,710 ‫How about we increase that to a hundred thousand? 84 00:05:17,190 --> 00:05:23,310 ‫No, right, and see, does it fail, does it fail, it's around a MEGG. 85 00:05:25,210 --> 00:05:30,710 ‫It's one Megg, one point three megabytes Quarrie, and it also succeeds. 86 00:05:31,060 --> 00:05:38,110 ‫Wow, badass sequel Postgres man, I did not know that or that's a long statement. 87 00:05:38,110 --> 00:05:40,070 ‫One make worth of Quarrie. 88 00:05:40,630 --> 00:05:41,260 ‫Wow. 89 00:05:41,260 --> 00:05:42,380 ‫OK, how about that. 90 00:05:42,400 --> 00:05:43,810 ‫How long is one Meg? 91 00:05:45,110 --> 00:05:46,790 ‫One mega choir, let's find it. 92 00:05:47,810 --> 00:05:51,190 ‫Can I search and find this? 93 00:05:51,980 --> 00:05:56,510 ‫Oh my God, 960 Tsipi Packards. 94 00:05:56,810 --> 00:05:58,730 ‫You know, this is a bad idea. 95 00:05:58,730 --> 00:06:06,680 ‫When you have a long career, it goes right because you so how how slow it is, because every kid has 96 00:06:06,680 --> 00:06:12,870 ‫to be acknowledged and and they have to be recorded if the order is lost. 97 00:06:13,040 --> 00:06:16,280 ‫So nine sixty packet is a lot of packets. 98 00:06:17,450 --> 00:06:17,960 ‫All right. 99 00:06:18,120 --> 00:06:19,430 ‫Are you guys ready for the million. 100 00:06:20,740 --> 00:06:21,450 ‫Is that a million? 101 00:06:22,040 --> 00:06:28,090 ‫Know, she's it is a million, one million elements, one million element. 102 00:06:28,340 --> 00:06:30,620 ‫Let's do it, Bo. 103 00:06:31,080 --> 00:06:31,920 ‫Let's clear this. 104 00:06:32,930 --> 00:06:33,910 ‫Let's clear this. 105 00:06:34,110 --> 00:06:35,060 ‫Are you guys ready? 106 00:06:35,120 --> 00:06:39,230 ‫Let's do it, one million element to. 107 00:06:40,970 --> 00:06:50,200 ‫That's oh, my 14 megs four oh oh oh, look at that, it's stuck, they did fail. 108 00:06:50,630 --> 00:06:51,890 ‫The guys think it failed. 109 00:06:52,950 --> 00:06:56,270 ‫Do you guys think it failed or are we still descending? 110 00:06:57,310 --> 00:06:58,630 ‫Oh, my gosh. 111 00:06:59,320 --> 00:07:11,500 ‫Oh, I don't think it failed, I just thought that there was an error that we couldn't handle a million 112 00:07:11,500 --> 00:07:13,680 ‫rows, which is a 14 mix. 113 00:07:13,930 --> 00:07:14,740 ‫But what happened? 114 00:07:14,740 --> 00:07:20,500 ‫And did we actually send all the way we need to send and the client just gets up? 115 00:07:20,930 --> 00:07:21,960 ‫Let's take a look. 116 00:07:22,450 --> 00:07:25,330 ‫We didn't even give that man look at that. 117 00:07:31,250 --> 00:07:38,250 ‫We crashed the server, guys, we crashed the server. 118 00:07:38,990 --> 00:07:43,970 ‫So look at that terminating connection because of the crash of another server. 119 00:07:44,330 --> 00:07:47,920 ‫Another quote unquote, another I'm pretty sure it does. 120 00:07:48,200 --> 00:07:49,280 ‫We just crashed it. 121 00:07:49,310 --> 00:07:56,180 ‫The postmaster has commended the server process to roll back that kind of transaction because another 122 00:07:56,180 --> 00:08:02,240 ‫server is another service processor, crushed a abnormally in the moment. 123 00:08:02,240 --> 00:08:05,300 ‫You should be able to reconnect to the database and repeat your comment. 124 00:08:06,420 --> 00:08:12,940 ‫I just thought that I think the number of packets received by the server has just overwhelmed the server 125 00:08:12,950 --> 00:08:13,940 ‫and that just died. 126 00:08:13,940 --> 00:08:20,990 ‫And because I have the free instance on one my elephant sequel, I bet that if I have like a better 127 00:08:20,990 --> 00:08:23,630 ‫instance, I bet that I can send a larger. 128 00:08:23,640 --> 00:08:25,370 ‫Let's try this one more time, guys. 129 00:08:25,390 --> 00:08:25,910 ‫How about that? 130 00:08:26,330 --> 00:08:27,350 ‫Try one more time. 131 00:08:27,950 --> 00:08:28,640 ‫But look at that. 132 00:08:28,650 --> 00:08:30,110 ‫It's actually stock. 133 00:08:31,970 --> 00:08:34,070 ‫We didn't even reach one million, did we? 134 00:08:34,370 --> 00:08:42,380 ‫We didn't the assemblage of the clients and just Sinden, I guess maybe the console, the log, we couldn't 135 00:08:42,380 --> 00:08:45,200 ‫print more than one million element, but. 136 00:08:46,280 --> 00:08:46,760 ‫Look at that. 137 00:08:46,850 --> 00:08:49,020 ‫Oh, no, it's just dying, man. 138 00:08:49,070 --> 00:08:52,330 ‫Yeah, it does not like that one bit. 139 00:08:53,570 --> 00:08:55,520 ‫Yeah, I get this now. 140 00:08:55,580 --> 00:08:58,230 ‫Now the process is stuck at the client side. 141 00:08:58,250 --> 00:08:58,470 ‫Yeah. 142 00:08:58,470 --> 00:08:58,780 ‫All right. 143 00:08:59,330 --> 00:09:01,580 ‫It's probably a bad idea to send the millions. 144 00:09:01,590 --> 00:09:03,380 ‫I'm going to kill this process. 145 00:09:03,660 --> 00:09:06,450 ‫All right, guys, my machine just died. 146 00:09:06,560 --> 00:09:07,010 ‫All right. 147 00:09:07,610 --> 00:09:07,880 ‫All right. 148 00:09:07,880 --> 00:09:14,030 ‫So we know 14 megs worth of aquaria is a bad idea. 149 00:09:14,030 --> 00:09:16,850 ‫And you can see my my MacBook is now spinning up. 150 00:09:16,850 --> 00:09:19,370 ‫I don't know if you can hear that, but it's a bad idea. 151 00:09:19,610 --> 00:09:26,600 ‫And have you ever guys, what is the longest or the largest? 152 00:09:28,170 --> 00:09:29,910 ‫Ha ha ha. 153 00:09:30,530 --> 00:09:33,650 ‫Hopefully my recording just doesn't die, but yeah. 154 00:09:33,680 --> 00:09:36,330 ‫What is the longest square have you ever sent? 155 00:09:36,500 --> 00:09:39,670 ‫Let me know in the comments section below before this recording crash. 156 00:09:39,680 --> 00:09:41,200 ‫I'm going to see you in the next one. 157 00:09:41,990 --> 00:09:43,040 ‫You guys say awesome. 158 00:09:43,460 --> 00:09:43,850 ‫Goodbye.