Normal Topic Ubuntu Fu? (Read 2045 times)
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Ubuntu Fu?
May 14th, 2014 at 6:21pm
Print Post Print Post  
Hi all,

I'm suffering some slowdowns with our Sesame database hosted on an Ubuntu server with Windows XP/7 machines. 

The real issue seems to be when something transmits a large amount of data (mass updating records, XPosting subrecords, etc).  When one client does an update like this, everyone else struggles to even advance a record with F10 until the update is done.

While I'm no Linux expert, when I 'ping -l 513' from my windows machine, I get a timeout, but anything under 512 bytes goes through.  That's weird, right?

I've increased the MTU from 300 to 10,000 on my Ubuntu network settings, and it's slightly better, but not perfect.

Does anyone with more Ubuntu-Fu have some suggestions on what I can do to better handle network traffic and speed up my database?

Thanks,
Blair
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Ubuntu Fu?
Reply #1 - May 14th, 2014 at 7:31pm
Print Post Print Post  
BWETTLAUFER wrote on May 14th, 2014 at 6:21pm:
Hi all,

I'm suffering some slowdowns with our Sesame database hosted on an Ubuntu server with Windows XP/7 machines. 

The real issue seems to be when something transmits a large amount of data (mass updating records, XPosting subrecords, etc).  When one client does an update like this, everyone else struggles to even advance a record with F10 until the update is done.

While I'm no Linux expert, when I 'ping -l 513' from my windows machine, I get a timeout, but anything under 512 bytes goes through.  That's weird, right?


Yes. Trying pinging one of your other machines with ping -l 513. The first part of this article may explain: http://www.draytek.com/index.php?option=com_k2&view=item&id=1415&Itemid=1581&lan...

Quote:
I've increased the MTU from 300 to 10,000 on my Ubuntu network settings, and it's slightly better, but not perfect.

Does anyone with more Ubuntu-Fu have some suggestions on what I can do to better handle network traffic and speed up my database?

Thanks,
Blair


Can you tell me more about your server machine? How many cores, how many users, how much memory, are you running any firewalls?

Running a mass update, for example, isn't going to create large network traffic (large singular chunks) as much as it is going to create a lot of small packets. Which leads me to believe that the problem is likely related to the CPU or memory being overtaxed or too many clients are trying to use the same commands or records at the same time. ...maybe.

In any case, there is a program (probably already installed) on Linux called "System Monitor". It can tell you a lot about what is going on when the going ons are going. It should be able to tell you about net bandwidth, memory use, CPU use, and etc.

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Ubuntu Fu?
Reply #2 - May 14th, 2014 at 11:08pm
Print Post Print Post  
Sir!

I've tried pinging other machines with a packet of over 512 and it never works if our switch is involved -- however it's an unmanaged gigabit switch, so that makes no sense.  I also can't ping externally anyone (but I bet I can when I get home).

My server is an Intel Xeon CPU 2.4 GHz x 8 with 12 GB Ram, running Ubuntu 12.04 LTE.  Aside from the firewall in our router to the outside world, that's it.

I've been running System Monitor for a week now to try to pinpoint the problem ... looking at it, the network isn't taxed, and the system is depending on one or two CPUs, but mostly ignoring the others.  Here's a screen cap.

Any other suggestions?
  

S81LIM_P.PNG ( 109 KB | 43 Downloads )
S81LIM_P.PNG
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Ubuntu Fu?
Reply #3 - May 15th, 2014 at 1:04pm
Print Post Print Post  
Unless you have "-server_dethread" turned on (do you?) you should be getting CPU usage for each command you are sending over. If two or more users are trying to run the same command or use the same resources (usually records) they will have to wait for each other.

Most of the commands run very rapidly and a single user action is usually comprised of quite a few server commands - with a few exceptions. Reports and large table-view sub-forms get their data in large chunks that may take a while for the server to send to the client. If you have several clients all trying to get large data at once, they can end up waiting on each other. That would create the pattern where out of several cores, only a few are being used. You can test this by having one client do as they normally do, and then have a few clients step through small sample applications with no sub-records. You should then see your CPU core usage expand.

There is a possibility that you are already seeing that here, though. Each command that gets sent to the server gets assigned its own "thread". Each thread, if one is available, gets set to a different core. But most of these server commands are very fast and small, running too quickly for the system monitor to register it as much activity at all. A few of the commands, on the other hand, are much larger and require a lot of server CPU activity over seconds or minutes. These would be seen as using many "CPU seconds".

Can you describe the "topology" of your application? Does it have a lot of big sub-form tables?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Ubuntu Fu?
Reply #4 - May 15th, 2014 at 2:25pm
Print Post Print Post  
Hi Mark,

Yes, I'm sure it is all tied to subforms.  Most of our files have a notes table which is a subform.  Recently I changed it from a linked to natural table, which helped a bit, but a lot of our heavy updates depend either on data in the subtable or noting it, using Xpost to create a new child record.  This is what bogs everyone else out even when they use simple commands like advancing to the next record.

In our workhorse form that is used for 80% of our work, we have approximately 130,000 parent records, each with 1-200 note records in our child table which totals about 1,200,000 notes and it's growing at a rate of about 1500 notes a day.  There are about 200 data fields in the parent record, and some form-entry and form-exit programming.

I don't have any dethreading on, and I understand that if I don't have SERVER THREADS: ON in my INI, it's threaded by default.  I do have SERVER PREINDEX RELATIONAL: ON in my INI.

Any suggestions?
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Ubuntu Fu?
Reply #5 - May 15th, 2014 at 2:59pm
Print Post Print Post  
Is the notes sub-form a form or table view?

Nevermind, I see that it is a table. How many elements in the sub-form?

How are you "creating" new records with XPost? Do you mean "XResultSet"?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Ubuntu Fu?
Reply #6 - May 15th, 2014 at 4:27pm
Print Post Print Post  
There are 8 elements in the subform in table view.

Here is a snippet of code showing one of our functions adding a note:

Code
Select All
// =================================
// Note SMS Attempt -- 2012-05-27
// =================================

DBWorked = @serverdate()

if @mode() = 1 then

{
	vNote = "SMS [" + DBTel1 + "]: " + vMessage

	vCount = @FormResultSetTotal("DRNotes")

	If vNote <> "" then
	{	If vCount = 1 Then
		{	If @FormFieldValue("DRNotes", "DRNote", 1) <> "" Then
			{	vNewNoteNo = @FormNewRecord("DRNotes")
			}
			Else
			{	vNewNoteNo = 1
			}
		}
		Else
		{	vNewNoteNo = @FormNewRecord("DRNotes")
		}
		gFileID = @ToNumber(@GlobalValue("gFileID")) +1
		vNewFileID = gFileID
		GlobalValue("gFileID", vNewFileID)

		FormFieldValue("DRNotes","DRNoteRef",vNewNoteNo,DBID)
		FormFieldValue("DRNotes","DRNoteDate",vNewNoteNo,@ServerDate())
		FormFieldValue("DRNotes","DRNoteTime",vNewNoteNo,@ServerTime())
		FormFieldValue("DRNotes","DRNote",vNewNoteNo,vNote)
		FormFieldValue("DRNotes","DRNoteID",vNewNoteNo,vNewFileID)
		FormFieldValue("DRNotes","DRNoteSig",vNewNoteNo,@UserID)
		FormFieldValue("DRNotes","DRNoteClt",vNewNoteNo,DBCltNo)
		FormCommit("DRNotes")

		vNote = @FormFieldValue("DRNotes","DRNote",vNewNoteNo)
	}
	Else
	{	If vNote = "" THEN @MsgBox ("", "You Cannot Enter a Blank Note!","")
	}

}
 

  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Ubuntu Fu?
Reply #7 - May 15th, 2014 at 8:43pm
Print Post Print Post  
Looking at your system monitor picture, it appears that you are using 1.6 gig of memory (out of 12). Is most of that being used by Sesame. One of the other tabs "Processes" will allow you to monitor memory use by process.

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
BWETTLAUFER
Full Member
***
Offline



Posts: 216
Location: Cambridge, Ontario
Joined: Apr 9th, 2010
Re: Ubuntu Fu?
Reply #8 - May 16th, 2014 at 3:47pm
Print Post Print Post  
I've been watching the processes, but I'm thinking the issue that I can't ping more than 512 bytes to my server is probably the core issue.  I don't think we're maxing out the server -- all it does is Sesame, and it's a pretty powerful machine.

Is there some sort of setting in Ubuntu other than MTU to open up the network handling speed?
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Ubuntu Fu?
Reply #9 - May 17th, 2014 at 2:44am
Print Post Print Post  
There are many Linux settings that affect network. But most of them default to good values or are auto-tuning. So unless someone has been changing them, they are probably happy numbers. Here is an article about tuning the net for a high speed network: http://fasterdata.es.net/host-tuning/linux/

Be carefully, much about network tuning is counter-intuitive. For example, setting the tcp/ip packet size larger sounds like a good idea in that each packet will then have a higher data to header ratio. But, if you set it higher than the ethernet (hardware) packet size, the data will get split between two or more ethernet packets and one may get sent nearly empty. Also, because of the nagle algorithm, the system will wait longer to send a packet because it takes longer for each packet to fill.

You might be having a network problem, and your statement about ping failures whenever using your switch, indicates that it is likely. Can you swap out the switch for another and see if that changes anything?

But, on the other hand, the system monitor of your network looks very content. The same image for your CPUs does not look so happy. If I were forced to guess, I'd say you have CPU congestion -- multiple threads waiting for a smaller number to complete. This is likely caused by the design of your application and the way it is used.

I could do some analysis on your system, but I am afraid that that can be somewhat disruptive. Steve-in-Texas, has a similar Linux based setup (much faster than Windows) with a large application and quite a few users. He allowed me to send him "debug" versions of Sesame, so that I could track down problems he was having. You might want to consult with him about the process and the business implications of going that route.

If that is out of the question (in most businesses that sort of disruption is too difficult), I'd be happy to take a look at your application (with suitable non-disclosures if need be) and see if I can find where the slow-down is occurring. If it is something in Sesame, find and fixing these issues benefits us both.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged