Hi.
I'm beginner about smartfox.
I'm writing very simple server extension and client stress tool.
In my server extension, do not perform any job.
Just a simple, empty server extension.
And, my stress tool, just connect, log in, create room and after join room, leave from it.
and loop from creating room again.
While checking internal test, I've found big problem.
Server uses more memory as time goes.
Slightly increase memory usage and... server died.
I don't know what the problem.
You can check
- server extension : https://drive.google.com/file/d/0B58j0l ... sp=sharing
- stress tool : https://drive.google.com/file/d/0B58j0l ... sp=sharing
- dash board capture : https://drive.google.com/file/d/0B58j0l ... sp=sharing
Please help me
Memory usage grownup and server died
Re: Memory usage grownup and server died
I don't have direct access to those files.
It would be much easier if you could just zip them all into one single archive and upload it directly in the forum.
There is an "Upload Attachment" button right below the text box.
Thanks
It would be much easier if you could just zip them all into one single archive and upload it directly in the forum.
There is an "Upload Attachment" button right below the text box.
Thanks
Re: Memory usage grownup and server died
thank you.
I'll attach it.
I'll attach it.
- Attachments
-
- memory.png
- memory usage
- (163.86 KiB) Not downloaded yet
-
- Makta.zip
- server extension
- (15.53 KiB) Downloaded 441 times
-
- CBStress.zip
- stress tool
- (19.67 KiB) Downloaded 449 times
- YoungDeveloper
- Posts: 48
- Joined: 02 Mar 2014, 21:38
- Location: Latvia
Re: Memory usage grownup and server died
Hey, this is not case, but i cant mention that you should consider applying patch, as new version is 2.8.2
Re: Memory usage grownup and server died
The Admin Screenshot doesn't show a memory crash. Did you actually get an OutOfMemory error or it's just the server that doesn't seem to respond?
I would recommend to check the status of the server queues during the test.
All Extension threads are working hard according to the thread monitor and it seems like you may need to increase the Extension threads.
Also you are using a database on the server side, and you are connecting all of the clients without any pause, inside a for loop. That's and unrealistic test to do. It may be good to stress test the system but the database query in comparison and your test will use up all the available threads.
You should read this document:
http://docs2x.smartfoxserver.com/Advanc ... hreadPools
I'd suggest to experiment with 10-20 threads for both the EventManager and ExtensionController so that you ensure enough scalability. Depending on the execution time of your DB queries you may need more threads.
Hope it helps
I would recommend to check the status of the server queues during the test.
All Extension threads are working hard according to the thread monitor and it seems like you may need to increase the Extension threads.
Also you are using a database on the server side, and you are connecting all of the clients without any pause, inside a for loop. That's and unrealistic test to do. It may be good to stress test the system but the database query in comparison and your test will use up all the available threads.
You should read this document:
http://docs2x.smartfoxserver.com/Advanc ... hreadPools
I'd suggest to experiment with 10-20 threads for both the EventManager and ExtensionController so that you ensure enough scalability. Depending on the execution time of your DB queries you may need more threads.
Hope it helps
Re: Memory usage grownup and server died
As YoungDeveloper pointed out, you also seem to be running a fairly old version of SFS. It's a pre 2.7.0
I'd recommend upgrading to 2.7 and applying the latest 2.8.2 update patch as well.
This is not directly related with your problems but in general there have been several fixes and overall improvements in the latest releases.
In the next 2.9 version we'll introduce a new auto-balancing threading system that will remove the necessity to tinker with all those Thread settings
cheers
I'd recommend upgrading to 2.7 and applying the latest 2.8.2 update patch as well.
This is not directly related with your problems but in general there have been several fixes and overall improvements in the latest releases.
In the next 2.9 version we'll introduce a new auto-balancing threading system that will remove the necessity to tinker with all those Thread settings
cheers
Re: Memory usage grownup and server died
when server not responses, there is logs like this.
java.lang.OutOfMemoryError: PermGen space ...
as your advice, I'll check your link and use new version of modules.
thank you all~~
java.lang.OutOfMemoryError: PermGen space ...
as your advice, I'll check your link and use new version of modules.
thank you all~~
Re: Memory usage grownup and server died
PermGen is not related with the memory graph you have showed. That graph shows the usage of heap memory.
Long story short, Heap Memory contains the object you create at runtime. PermGen (permanent generation) Space is a different area of memory dedicated mostly to class definitions. In other words that's where Classes are loaded by Class Loaders.
It sounds like you are creating lots of Rooms with attached Extensions. Since every Extension is loaded in a separate Class Loader you may end up using lots of PermGen memory especially if you have other dependencies deployed with the Extension (DB drivers, 3rd party jars etc...)
Make sure all of your Extension dependencies are deployed in the extension/__lib__/ folder to avoid reloading them for every Room.
Also take a look here for more details on Class Loaders:
http://docs2x.smartfoxserver.com/Advanc ... extensions
Long story short, Heap Memory contains the object you create at runtime. PermGen (permanent generation) Space is a different area of memory dedicated mostly to class definitions. In other words that's where Classes are loaded by Class Loaders.
It sounds like you are creating lots of Rooms with attached Extensions. Since every Extension is loaded in a separate Class Loader you may end up using lots of PermGen memory especially if you have other dependencies deployed with the Extension (DB drivers, 3rd party jars etc...)
Make sure all of your Extension dependencies are deployed in the extension/__lib__/ folder to avoid reloading them for every Room.
Also take a look here for more details on Class Loaders:
http://docs2x.smartfoxserver.com/Advanc ... extensions
Re: Memory usage grownup and server died
As you can see in my extension source code, only jars which linked with my extension are below
You mean, I must copy these jars to 'C:\Program Files\SmartFoxServer_2X\SFS2X\extensions\Makta' ?
You mean, I must copy these jars to 'C:\Program Files\SmartFoxServer_2X\SFS2X\extensions\Makta' ?
Re: Memory usage grownup and server died
No. I am saying the opposite. In the extensions\Makta\ folder just put your compiled extension jar.
All the dependencies (like the mysql jar etc...) should go in the extensions\__lib__\
Is this what you are doing?
All the dependencies (like the mysql jar etc...) should go in the extensions\__lib__\
Is this what you are doing?
Who is online
Users browsing this forum: No registered users and 65 guests