Original Message:
Sent: Mon April 17, 2023 10:07 AM
From: Pablo Guzmán Barberán
Subject: Making faster ODBC resquests from .NET to Power 8
Hi Satid, a couple of questions for you:
"I noticed from your screen shots that you still use ODBC driver from the unsupported IBM i Access for Windows. If possible, you should use ODBC driver from IBM i ACS instead."
Which of these i have to use?

When youu say that We have to use a pool connection, where i have to locate that property?
------------------------------
Pablo Guzmán Barberán
Original Message:
Sent: Fri April 14, 2023 09:04 PM
From: Satid Singkorapoom
Subject: Making faster ODBC resquests from .NET to Power 8
Dear Pablo
>>>> Maybe i forgot to tell you that we have 2 types of sp: SQL statements and others than excute a rpg program. <<<<
Do your RPG stored procedures contain embedded SQL? If so, what I described in my first post applies. If no, it means RPG "native I/O" is used and this means that RPG programmer needs to identify and create keyed logical files (based on the same principle I described earlier for SQL) and modify RPG code to use those keyed LFs for data access with good performance. Ask your RPG programmers whether or not they implement the use of keyed LF (based on the principle I described earlier for SQL) in their RPG codes.
Using RPG native IO for data access is like driving a car with "manual gear", the programmer needs to implement every proper step of data access for good performance which usually involves the use of keyed LFs (still use the same principle I described to identify and create keyed LFs). Using SQL is like driving an "automatic gear" car, you identify and create useful indexes using DB2i tools and DB2 SQL engine will use them automatically.
You should encourage your programmer to use embedded SQL or even create pure SQL stored procedures when possible, unless your RPG programmer is already an RPG expert.
I noticed from your screen shots that you still use ODBC driver from the unsupported IBM i Access for Windows. If possible, you should use ODBC driver from IBM i ACS instead.
>>>> We sent a stress test to our .net web service with 500 requests in 1 minute. We realize that the application "stops" for 3 seconds at the 100th iteration and then works again but with a long average time of response. What can be? <<<<
First of all, set a proper size for TCP/IP send and receive buffer with CHGTCPA. I suggest a size of 204800 (200KB). Do the same in Windows web server which should be done from the LAN card device driver (Windows Device Manager?).
If the problem still persists, do you use a tool to generates the transactions of the stress test? If so, that 3-second freeze and transaction response time degrade may be from the tool. If you are sure the stress test tool is not the cause of this problem, then you may need to do a communication trace during such a stress test and analyze it with WireShark tool to possibly get the answer.
How many max concurrent users do you expect to use this transactions in actual workload? If a lot, you should consider using a connection pool. The use of message queue has been very rare in my part of the world mainly because it requires programmers to write different style of codes from using SQL with connection pool.
In my experience, at 500 requests per minute, you may not see much performance improvement with connection pool. But if you are looking at 1,000 requests per minute or more, connection pool may likely deliver some overall performance improvement. This also depends on the performance of front-end and back-end servers' hardware. What is your IBM i server model and with how many active CPU cores and how much memory and what type of disk are being used? What about Windows web server HW that makes ODBC requests to IBM i?
Please read my "case 3" article to get an overall idea about your case (read the 2nd case about half way down the entire article below figure 5 - the first case is irrelevant to you now) : Guru: IBM i Experience Sharing, Case 3 – When Performance Issues Come From Without at https://www.itjungle.com/author/satid-singkorapoom/
Feel free to ask any further questions.
BTW, in the future, please ask IBM i-related questions in a group named IBM i Global at https://community.ibm.com/community/user/power/communities/community-home?CommunityKey=f0246bc4-08f3-43c5-a7f8-b6a64d387894.
------------------------------
Education is not the learning of facts but the training of the mind to think. -- Albert Einstein.
------------------------------
Satid S.
Original Message:
Sent: Fri April 14, 2023 09:41 AM
From: Pablo Guzmán Barberán
Subject: Making faster ODBC resquests from .NET to Power 8
Hi everyone, thanks Diego and Satid for your suggestions. I will try them and i will inform you the results. I'll hope that all together will achieve the best performance.
Maybe i forgot to tell you that we have 2 types of sp: SQL statements and others than excute a rpg program.
------------------------------
Pablo Guzmán Barberán
Original Message:
Sent: Wed April 12, 2023 04:49 PM
From: Pablo Guzmán Barberán
Subject: Making faster ODBC resquests from .NET to Power 8
Hi everyone, I found this community today and I like it. My issue is related to the duration of the execution of some stored procedures from .NET to DB2. I think that we can improve the setup of the ODBC or modify the connection string properties to make it faster.
Do you have any ideas to help? I will thank forever.
Pablo
------------------------------
Pablo Guzmán Barberán
------------------------------