<div dir="ltr"><div>No MySQL gurus here? : (</div><div>Excuse me for firing a barrage of questions over there, but I still demand an answer.</div><div>Thanks ever so much.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 30, 2019 at 4:26 PM Donat Zenichev <<a href="mailto:donat.zenichev@gmail.com">donat.zenichev@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Seems I found a way out:</div><div><br></div><div>I added 'contact_id' primary key into a list of sources columns for an unique key, so now it looks as following:<br> PRIMARY KEY (`contact_id`),<br> UNIQUE KEY `account_contact_idx` (`username`,`domain`,`contact`,`callid`,`contact_id`)</div><div><br></div><div>It didn't increase the loading on the CPU that much, but now I have:<br></div><div>- absence of duplicate entries (that were causing 1032 errors when failing over to slave side)</div><div>- pretty nice capacity, as I had with usual 'account_contact_idx' (that was without 'contact_id' PK)</div><div><br></div><div>But currently I have some doubts that this will cause some unpredictable behavior.</div><div>MySQL gurus, any insight on this?</div><div><br></div><div>Thanks for your attention in advance!<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 30, 2019 at 12:38 PM Donat Zenichev <<a href="mailto:donat.zenichev@gmail.com" target="_blank">donat.zenichev@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi opensips community.<br><br>I have a question about an sql structure of the location table.<br>I came across a capacity obstacle when working without 'account_contact_idx' on the opensips version 2.4+<br>I'm completely aware that 'account_contact_idx' was deprecated after the 2.1 branch.<br><br>What did I do, was setting up of the database structure as for 2.4 version, but with added 'account_contact_idx' unique key to a location table.<br>Why did I do this? Because the capacity of the database increased by several times.<br><br>As an example:<br>When having a usual 2.4 version db structure, a sending of 50-60 registrations per second gives me 2/3 of requests that are re-transmitted.<br>When having a location table with 'account_contact_idx' unique key, I can send 700+ registrations per second without any re-transmissions occurred.<br><br>Why does it happen?<br><br>My mysql setup is as following:<br>Version - 5.7.27<br><div>engine for opensips database - innodb<br></div><div><br></div><div>binlog_format = mixed <--- needed to fix a replication errors 1032/1062 when failing over</div>max_connections = 2000<br>max_allowed_packet = 16M<br>table_open_cache = 2000<br><div>max_binlog_size = 500M</div><div><br></div><br>It almost works out well with 'account_contact_idx' unique key, but it generates lots of duplicate entries, that's I want to deprecate this.<br>But I don't know of how to save the same capacity as we have with that unique key.<br><br>Looking forward to any advice, thanks!<br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Best regards,<br></font></div><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Donat Zenichev<br><br></font></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Best regards,<br></font></div><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Donat Zenichev<br><br></font></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Best regards,<br></font></div><div dir="ltr"><font style="background-color:rgb(255,255,255)" color="#0b5394">Donat Zenichev<br><br></font></div></div></div></div></div></div></div></div>