slowness

slowness

Postby MarcoBoschi » Wed Sep 11, 2024 2:15 pm

Hi,
this little example executed in a lan environment in which the server is linux, microsoft or simply a shared folder from a windows 10 client, highlights that if the dbf table is open from another user in another pc or even in the same pc the execution speed is very very fast. The same speed as when the dbf table is opened only by this program.
Things also change a lot when the cdx file is opened in addition to the dbf file.
The execution speed decreases an half second till five six seconds
I'd like to know which is the problem, if we can talking of problems or if is normal this enormeus difference of speed. In my opinion is not normal.

recap:
- DBF AND CDX OPENED FROM ANOTHER USER SLOW
- ONLY DBF OPENED FROM ANOTHER USER: FAST
- DBF AND CDX OPENED ONLY FROM ME

I understand that indices are fundamental but they are very heavy. I hope I'm doing something wrong

Many thanks to all

Marco

Code: Select all  Expand view
ANNOUNCE RDDSYS


FUNCTION MAIN( )

CLS
SET DELETED ON
SET EXCLUSIVE OFF


SET AUTOPEN OFF
DO WHILE .T.

   nInizio := SECONDS()

   SELECT 0
   USE m:\marco\JALA
   SET INDEX TO m:\marco\JALA
   GO TOP


   ? SECONDS() - nInizio
   nInizio := SECONDS()

   DO WHILE !EOF()
      @ 10 , 10 SAY field->bol_lav
      SKIP
   ENDDO
   ? RECNO() , SECONDS() - nInizio

   IF INKEY( 1 ) = 27
      EXIT
   ENDIF

   USE

ENDDO


RETURN NIL


INIT PROCEDURE RddInit
REQUEST DBFFPT
REQUEST DBFCDX
rddSetDefault( "DBFCDX" )
RETURN

 
User avatar
MarcoBoschi
 
Posts: 1055
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: slowness

Postby karinha » Wed Sep 11, 2024 3:18 pm

Code: Select all  Expand view

// BOSCHI.PRG

FUNCTION Main()

   CLS

   CLEAR MEMORY

   HB_GCALL( .F. )

   SET DELETED ON
   SET EXCLUSIVE OFF
   SET MULTIPLE OFF
   SET OPTIMIZE ON

   WHILE( .T. )

      nInizio := Seconds()

      SELECT 0  // ??  1 ?

      USE m:\marco\JALA          // ???
      SET INDEX TO m:\marco\JALA

      GO TOP

      ? Seconds() - nInizio

      nInizio := Seconds()

      WHILE( .NOT. EOF() )

         IF EOF()

            EXIT

         ENDIF

         @ 10, 10 SAY FIELD->Bol_Lav

         SKIP

      ENDDO

      ? RecNo(), Seconds() - nInizio

      IF Inkey( 1 ) = 27

         EXIT

      ENDIF

      USE

   ENDDO

   HB_GCALL( .T. )

RETURN NIL

INIT PROCEDURE RddInit

   ANNOUNCE RDDSYS

   REQUEST DBFCDX, DBFFPT

   rddSetDefault( "DBFCDX" )

RETURN

// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7613
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: slowness

Postby MarcoBoschi » Thu Sep 12, 2024 10:22 am

Karinha,
I tested your code unsuccessful.
Very quickly if I work alone with dbf and cdx and very slow if the dbf and cdx tables are open from another user.

Many thanks anyway

Marco
User avatar
MarcoBoschi
 
Posts: 1055
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: slowness

Postby karinha » Thu Sep 12, 2024 1:06 pm

Marcos, is the database very large? Is the Network via WiFi? Is the network card old?

Marcos, ¿la base de datos es muy grande? ¿La Red es vía WiFi? ¿La tarjeta de red es antigua?

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7613
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: slowness

Postby MarcoBoschi » Thu Sep 12, 2024 1:22 pm

Directory di M:\marco

11/09/2024 00:00 781.312 JALA.cdx
29/08/2024 13:33 6.525.890 Jala.dbf
29/08/2024 13:33 1.051.968 Jala.fpt

cable 1.0 Gbps

LAN_SpeedTest.exe
Bits per seconds
Writing 365,793,632
Reading 720,237,968
User avatar
MarcoBoschi
 
Posts: 1055
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: slowness

Postby Jimmy » Thu Sep 12, 2024 1:43 pm

hi Marco,

this is the normal SMB behavior.

when DBF is used in Share Mode only Once, it will use SMB "Exlusive Locking" Mode
as soon when DBF was opened second Time it will switch into "Opportunistic Locking" Mode https://learn.microsoft.com/de-de/windo ... stic-locks
it have to do with Cache which in "Opportunistic Locking" Mode is much slower while must take Care when Data is opened by Different Clients.

so open DBF only when need and close it as soon as possible in Network to get max Performance,
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1691
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: slowness

Postby MarcoBoschi » Thu Sep 12, 2024 2:23 pm

Jimmy,
remember this: if CDX files is not open the speed is the same. It's a problem concerned with the use of index files.
Why only for cdx files opened?

Many thanks for your eplanation.
User avatar
MarcoBoschi
 
Posts: 1055
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: slowness

Postby MarcoBoschi » Thu Sep 12, 2024 2:32 pm

I forgot to say that this dbf table is the PBX CDR and it is open 24/7. Bye
8)
User avatar
MarcoBoschi
 
Posts: 1055
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: slowness

Postby karinha » Thu Sep 12, 2024 2:39 pm

Marcos, you need to turn off the machine to free up the memory at least once a day for at least 10 minutes.

Marcos, necesitas apagar la máquina para liberar memoria al menos una vez al día durante al menos 10 minutos.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7613
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: slowness

Postby MarcoBoschi » Thu Sep 12, 2024 2:49 pm

Is not possible Karinha it's a server
User avatar
MarcoBoschi
 
Posts: 1055
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: slowness

Postby karinha » Thu Sep 12, 2024 3:07 pm

MarcoBoschi wrote:Is not possible Karinha it's a server


Así que será mejor que recomiendes un segundo SERVIDOR, tipo BACKUP para que puedas hacer la parada técnica en el SERVIDOR PRINCIPAL.

So, you'd better recommend a second SERVER, like BACKUP so that you can make the technical stop on the MAIN SERVER.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7613
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: slowness

Postby Jack » Thu Sep 12, 2024 3:18 pm

Hi,

Same problem as you .

It is time to go to SQL .

Philippe
Jack
 
Posts: 284
Joined: Wed Jul 11, 2007 11:06 am

Re: slowness

Postby MarcoBoschi » Thu Sep 12, 2024 3:27 pm

Hi,

Same problem as you .

It is time to go to SQL .

Philippe

too difficult for me and to much time and Im and old man
User avatar
MarcoBoschi
 
Posts: 1055
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: slowness

Postby MarcoBoschi » Thu Sep 12, 2024 3:33 pm

Marcos, you need to turn off the machine to free up the memory at least once a day for at least 10 minutes.

I will try!


Thanks
User avatar
MarcoBoschi
 
Posts: 1055
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: slowness

Postby Otto » Thu Sep 12, 2024 4:15 pm

Marco, how many users are accessing simultaneously? How large are your databases?
It’s hard to give advice without knowing the specifics.
I also noticed back then that when SMB-2 is enabled and you still have older Windows versions running on the network at the same time, it becomes extremely slow.
We always disabled SMB-2 back then. Jimmy posted a good guide at that time.
Why don’t you switch to Remote Desktop?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6255
Joined: Fri Oct 07, 2005 7:07 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 47 guests