1. Smart City doo
  2. Valentina Server
  3. 木, 1月 23 2020, 04:19 PM
  4.  メールで購読
I've had a situation where vServer used 95% of RAM and all connections were slow.

Is there any way to release memory?

Restart solved the problem but it is not regular.

regards,
Zoran
コメント
There are no comments made yet.
Ivan Smahin 承諾済みの回答
Please check, that cursors are destroyed. Judging on the vServer logs you sent me recently - there are tons of cursors - living but not used.
コメント
There are no comments made yet.
Smart City doo 承諾済みの回答
Please check, that cursors are destroyed. Judging on the vServer logs you sent me recently - there are tons of cursors - living but not used.

I am sure you are right, but in cursor count column, there is only 1-3 cursors active by connection (20-30 connections)
Can I destroy all cursors periodicaly by sendind some command to clean database while I found my vCursors not destroyed in code?

regards
コメント
There are no comments made yet.
Ruslan Zasukhin 承諾済みの回答
Hi,

A Cursor can be destroyed only by who have created it.

Cursor not always means a lot of RAM. It depends on query. Some cursors can select only 1 record, other can select a lot of records.

Good advice is - use a query that selects a small number of records.
コメント
There are no comments made yet.
Smart City doo 承諾済みの回答
Hi,

A Cursor can be destroyed only by who have created it.

Cursor not always means a lot of RAM. It depends on query. Some cursors can select only 1 record, other can select a lot of records.

Good advice is - use a query that selects a small number of records.


Lets consider next scenario:

Client connected to vServer crashes with some cursor loaded.
Can I destroy this cursor on next App init?

Meybe I can restart vServer periodicaly to clean all unused cursors?
コメント
There are no comments made yet.
Smart City doo 承諾済みの回答
Hi,

A Cursor can be destroyed only by who have created it.

Cursor not always means a lot of RAM. It depends on query. Some cursors can select only 1 record, other can select a lot of records.

Good advice is - use a query that selects a small number of records.


Another question.
If I make nightly connections kill on vServer, will I clean cursors?

regards
コメント
Do you mean admin's command "drop connections"? yes, it should clean up.
  1. Ruslan Zasukhin
  2. 4 年前
There are no comments made yet.
Ivan Smahin 承諾済みの回答
Connections crashes should be ok - it is just "unexpected connection termination" for vServer.
Cursors are destroyed either by calling vCursor's destructor on particular connection side or by closing vClient database/connection.
All scenarios above lead to closing vServer-side cursors.
Also, vServer may decide to disconnect some client (idle timeout for example). In this case its cursors will be destroyed as well.

I guess you have some long-running connections which are not destroying own cursors. There are no external way to destroy such cursors except killing such connections.
But better check your client-side workflow - obviously there are dangling objects and memory leaks.
コメント
There are no comments made yet.
Smart City doo 承諾済みの回答
Connections crashes should be ok - it is just "unexpected connection termination" for vServer.
Cursors are destroyed either by calling vCursor's destructor on particular connection side or by closing vClient database/connection.
All scenarios above lead to closing vServer-side cursors.
Also, vServer may decide to disconnect some client (idle timeout for example). In this case its cursors will be destroyed as well.

I guess you have some long-running connections which are not destroying own cursors. There are no external way to destroy such cursors except killing such connections.
But better check your client-side workflow - obviously there are dangling objects and memory leaks.

Thank you.
This helps.
コメント
There are no comments made yet.
Smart City doo 承諾済みの回答
Connections crashes should be ok - it is just "unexpected connection termination" for vServer.
Cursors are destroyed either by calling vCursor's destructor on particular connection side or by closing vClient database/connection.
All scenarios above lead to closing vServer-side cursors.
Also, vServer may decide to disconnect some client (idle timeout for example). In this case its cursors will be destroyed as well.

I guess you have some long-running connections which are not destroying own cursors. There are no external way to destroy such cursors except killing such connections.
But better check your client-side workflow - obviously there are dangling objects and memory leaks.


I tried
DROP CONNECTIONS OF DATABASE mydatabase
from vStudio but my vServer hangs?!

Bookmark entry in vStudio is grey - not green or red.

I have to kill process from task manager to get vServer start again.

Where am I going wrong?
コメント
There are no comments made yet.
Ivan Smahin 承諾済みの回答
I will try to reproduce it first - send me the vServer log please
コメント
There are no comments made yet.
Smart City doo 承諾済みの回答
I will try to reproduce it first - send me the vServer log please
Logs...
添付ファイル
コメント
There are no comments made yet.
Smart City doo 承諾済みの回答
I will try to reproduce it first - send me the vServer log please
Any news? ;)
コメント
There are no comments made yet.
Ivan Smahin 承諾済みの回答
No news for now. But probably things go better with a new release (v.10.0.2).

Did you check that "dangled" cursors in your app? Anyway, it seems that your app do something like this one:
Open connection, do some queries (probably in the loop), and forget to destroy cursors.
So, if the connection lives long enough, you will get some "dangled" cursors in each connection, but vServer has no idea that they are not used anymore and can do nothing to destroy them.

You may try following - download the latest vServer release and using vStudio's "Tools/Server Admin" - disconnect all the clients (except yours) and see - does vServer's memory get back to the "normal"?
コメント
There are no comments made yet.
  • ページ :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.