Gor is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.
usefull links
https://github.com/buger/goreplay/wiki/Running-on-Windows
be aware if you listen to port 8000 you must have a live server on this port up and running.
on windows i get failed to listen on the localhost ( some loopback issue on the netwrok) , there are some post/articles about this issue e.g. https://github.com/buger/goreplay/issues/440
but non- of them help me to capture from local host.
so i access my web server from remote and its work perfectly .
mean:
gor is running from the webserver machine e.g MyServer , and connect to port e.g 7001.
i access to this webserver from remote machine via url , e.g. http://MyServer :7001
starter command
-- will replay only POST method from the file requests.gor
goreplay.exe --input-file requests.gor --output-http="http://localhost:7001" --http-allow-method POST
-- replay all request
goreplay.exe --input-file new_contact_0.gor --output-http="http://hlvm-yanivt:7001"
--replay all request and log response
goreplay.exe --input-file new_contact_0.gor --output-http="http://hlvm-yanivt:7001" --output-http-track-response --input-raw-track-response --output-file=new_contact_play.gor
--start record and log response
goreplay.exe --input-raw :7001 --output-stdout --output-http-track-response --input-raw-track-response --output-file=requests.gor
enjoy
Yaniv Tzanany
This Blog is first of all memos for me!! From time to time I get exposed to new and cool stuff for developers and architects ,most of the time its a solution for a problem or tips or tricks, so, I would like to track my memos and share it with you, it can save your time and nervous, I hope you will enjoy it - by Yaniv Tzanany.
Search This Blog
Tuesday, October 15, 2019
Thursday, September 19, 2019
CreateProcess failed from Windows service - windows child process limits
I built a windows service that spawn child process , i noticed that after 100 childs process creation , i get failed to create new process, no error , just return immediately right after creation.
i am waiting on each process handle.
when i run the service from console , all work fine.
when i set my service to interact with desktop , seems to be fine.
from google search i found those article who helps me at least to increase the number of processes .
child process limits in service context and conhost.exe
How to increase the maximum number of child processes that can be spawned by a windows service — desktop heap limits
i used in my case DETACHED_PROCESS as a parameter to CreateProcess api , and i managed to increase from 100 to about 300 childs.
bSuccess = CreateProcess(NULL,
(LPSTR)(LPCTSTR)commandLine , // command line
NULL, // process security attributes
NULL, // primary thread security attributes
TRUE, // handles are inherited
DETACHED_PROCESS, // creation flags
NULL, // use parent's environment
NULL, // use parent's current directory
&siStartInfo, // STARTUPINFO pointer
&piProcInfo); // receives PROCESS_INFORMATION
still need to check how to increase the desktop heap ...
i found this solution at How to increase the maximum number of child processes that can be spawned by a windows service — desktop heap limits
more info about desktop heap
https://support.microsoft.com/en-us/help/947246/you-may-receive-an-out-of-memory-error-message-because-of-the-desktop
https://support.microsoft.com/en-us/help/184802/user32-dll-or-kernel32-dll-does-not-initialize
https://www.ibm.com/support/pages/using-performance-monitor-alerts-warn-desktop-heap-problems
good luck
yaniv tzanany
i am waiting on each process handle.
when i run the service from console , all work fine.
when i set my service to interact with desktop , seems to be fine.
from google search i found those article who helps me at least to increase the number of processes .
child process limits in service context and conhost.exe
How to increase the maximum number of child processes that can be spawned by a windows service — desktop heap limits
i used in my case DETACHED_PROCESS as a parameter to CreateProcess api , and i managed to increase from 100 to about 300 childs.
bSuccess = CreateProcess(NULL,
(LPSTR)(LPCTSTR)commandLine , // command line
NULL, // process security attributes
NULL, // primary thread security attributes
TRUE, // handles are inherited
DETACHED_PROCESS, // creation flags
NULL, // use parent's environment
NULL, // use parent's current directory
&siStartInfo, // STARTUPINFO pointer
&piProcInfo); // receives PROCESS_INFORMATION
still need to check how to increase the desktop heap ...
i found this solution at How to increase the maximum number of child processes that can be spawned by a windows service — desktop heap limits
WARNING: this affects the desktop heap of all services! Do not make it larger than necessary or you will push the system to consume more resource and you may bump up against problems in the total available desktop heap size.
If you find that you cannot open more than about 100 total projects, even on a very large RAM server, you may have run into a limit of the Windows "desktop heap size".
The problem is that service sessions under windows (where the services run) have less of this "desktop heap" space available for creating windows.
The short version is:
- Services get smaller desktop heaps than interactive sessions.
- Desktop heap size limits the number of windows
- Each sub-server creates one or more “windows” even if we can’t see them.
Solution:
- Backup your registry before making any changes!
- Run regedit.exe as administrator
- Edit the registry value:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\SubSystems\Windows - You will see a string like:
%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,20480,768 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ServerDll=sxssrv,4 ProfileControl=Off MaxRequestThreads=16
The critical bit is:
SharedSection=1024,20480,768
The second number (20480) is the size for interactive sessions. The third number (768) is the size of non-interactive (services) sessions. Note how the third number is 26x smaller than the second. Experimentally, we found that changing this to:
SharedSection=1024,20480,2048
Increased the project limit from 106 to 270, almost perfectly scaling with the heap size. Pick a value that reflects the maximum number of projects that you expect to be opened simultaneously by all users on the system. Do not make this value larger than necessary, and no larger than 8192, as each service in your system will consume more of a precious resource.
more info about desktop heap
https://support.microsoft.com/en-us/help/947246/you-may-receive-an-out-of-memory-error-message-because-of-the-desktop
https://support.microsoft.com/en-us/help/184802/user32-dll-or-kernel32-dll-does-not-initialize
https://www.ibm.com/support/pages/using-performance-monitor-alerts-warn-desktop-heap-problems
yaniv tzanany
Wednesday, September 18, 2019
Monday, September 16, 2019
Android Emulator: Process finished with exit code -1073741819
the solution that works for me was
- find your avd folder.(If your using Windows OS, the default path is
C:\Users\USER_NAME\ .android\avd\YOUR_VIRTUAL_DEVICE_NAME.avd) - open the file
config.ini - find
hw.gpu.modeand set it tooff(hw.gpu.mode=off) - launch the AVD manager
- launch your virtual device.
reinstall emulator + haxm didnt worked for me only the above.
enjoy
Yaniv Tzanany
Monday, September 9, 2019
Android Build Types and Product Flavors
Very good tutorial to generate few build type
https://www.journaldev.com/21533/android-build-types-product-flavors#targetText=Android%20Build%20Types,you%20to%20sign%20the%20APK.
Monday, August 12, 2019
Dialog flow advanced samples
very good video how to use context and values between intents.
Great video how to connect dialog flow with firebase DB - write and read from/to DB
Integrate dialog with external api
Tuesday, August 6, 2019
Subscribe to:
Posts (Atom)