Read the following to regist, edit or delete the MagicINFO Server service.
Regist / Delete the service
You can specify options additionally or change options that will be applied by default when running the service of MagicINFO Server.
And it can be applied by deleting from and registering to Windows service.
For example, in case jvm is out of memory, you can change the size of heap memory or perm memory.
How to change the options
First, go to the below path and find "service.bat" file.
File path : {The path installed the MagicINFO Server}\tomcat\bin\service.bat
After opening the file with a text editor, move the page down and check the command under :installed. (Refer the below image)
You can specify or change the options that will be executed when the service is registed and started.
For the related options, refer the configuration of daemon execution.
The list of options : https://commons.apache.org/proper/commons-daemon/procrun.html
After modifying(adding/editing/deleting) the options related to daemon configuraion, stop, delete and restart the registed service.
Execute in order : Stop the service → Delete the service → Install the service → Restart the service
Type | Command |
---|---|
Delete service | service uninstall |
Install service | service install |
Tomcat Configurations (modify server.xml)
You can modify the settings that required for executing the web service when running tomcat.
After opening below file with a text editor, modify the options that you need and save, and restart MagicInfoPremium service to take effect.
File path : {The path installed the MagicINFO Server}\tomcat\conf\server.xml
The descriptions of existing options
option | description |
---|---|
port | Specify a port number that the connector operates on. If the port is already in use, then you can change the port number to use. |
maxHttpHeaderSize | If there is a lot of information in the HTTP Header, it needs to be modified according to the characteristics of the service. (The default value is 4KB) |
maxThreads | It is very important option. This option determines the number of threads in tomcat. The number of threads means the number of active users. In other words, it means the number of transactions that can be processed instantly. Generally, around 100 is the most appropriate, and it is common to set around 50 to 500 depending on the weight of the transaction.It is better to adjust this value while tuning through a performance test. |
acceptCount | This option defines the length of the request queue. When an HTTP request comes in, if there is no idle thread, this is the length of the queue waiting for the request until an idle thread is created in the queue. Normally, messages that piled up in the queue means that there is no thread available to process the Tomcat instance, and it is likely that it is already in a disability state that requests cannot be processed even if all threads are used. So, it is better to make short the length of queue than make long. Because if requests cannot be processed any more, it's better to send an error code to clients as soon as possible to handle the error. If the length of the queue is long, the waiting time becomes longer. Then, there can be a case that the response is continuously waiting even in a failure situation and then propagated to another failure. |
maxPostSize | When using tomcat, if too much data is sent in the post method, request data can be initailized(be null). So, when transmitting form data in the post method, if the size of form data exceeds 2M(default value), it must be set separately. |
secure SSLEnabled sslProtocol sslEnabledProtocols | The option is regard of SSL settings. For more information, refer to below link. |
For more information, refer the official site of Tomcat.
Official site : https://tomcat.apache.org/tomcat-8.0-doc/config/http.html
Delete Tomcat cache
Basically, when a web-application is deployed by tomcat, the cache is left.
Because of cache, when changes are made to the web-application file ({The path installed the MagicINFO Server}\server), it may not be applied properly.
In this case, delete all folders and files under the folders that cache is stored and restart the MagicINFO Server service.
When you delete the cache, tomcat may not run properly, so you must back up the folders before deleting just in case.
Folder path : tomcat\temp, tomcat\webapps, tomcat\work
How to check tomcat log
To check the log about tomcat operation, refer to files under the folder "tomcat\logs".
You can figure out the problem of tomcat operation and tune the settings based on the logs.
The Types of log files
File name | Description |
---|---|
catalina.YYYY-MM-DD.log | Server start, stop, service start, stop information (for tomcat) |
host-manager.log | Tomcat Host Manager Web app log (virtual host manager) |
manager.log | Tomcat Manager Web App log (web console) |
localhost.log | Host (same to VirtualHost) limited log |
commons-daemon.log | Daemon(background service) execution log |
magicinfo*.log | Log for each products in MagicINFO |
Tomcat Monitoring and how to tune
When you encounter problems such as slow operation of Magicinfo server, you can grasp the execution status of threads used by Tomcat and tune it according to the server execution status.
- Monitoring using Tomcat manager
- Tomcat can be monitored using Tomcat Manager.
- Tomcat Manager provides the server status and request status, so administrators can use this information usefully when solving problems.
Tool : JConsole
Reference Site
JConsole https://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html
2. Tuning
- You can identify the cause of performance issue and solve the problems by analyzing the dump using thread dump.
Tool : jstack, samurai, tda
Reference Site
Jstack https://docs.oracle.com/javase/9/tools/jstack.htm#JSWOR748