Skip to content

Commit ae7f476

Browse files
authored
Merge pull request #43 from dylan171/server_perf
Improvements to RecCeiver performance
2 parents 8c73e3d + a9debc6 commit ae7f476

File tree

6 files changed

+360
-157
lines changed

6 files changed

+360
-157
lines changed

debian/changelog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
recsync (1.3.6) unstable; urgency=low
2+
3+
* Send PING message immediately when DONE message is received
4+
* Commit transactions sequentially and support cancellation
5+
* Collect and log more performance metrics
6+
* Remove the extra newline character from the log messages
7+
* Add support for cfstore commit cancellation
8+
* Allow the ChannelFinder client size limit to be configured
9+
* Improve cfstore performance by hashing PV info by PV name instead of RID
10+
11+
-- Dylan Maxwell <maxwelld@frib.msu.edu> Fri, 14 Mar 2019 10:11:12 -0400
12+
113
recsync (1.3.5) unstable; urgency=medium
214

315
* Fix bug with client that caused RIDs to be reused when more than 65536 records

server/demo.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ procs = show
4444
# Doesn't effect IOC clients
4545
#commitInterval = 5.0
4646

47+
# Maximum size before committing updates
48+
# The default is 0 (which is no limit)
49+
#commitSizeLimit = 0
50+
4751
# Maximum concurrent "active" clients
4852
# to allow.
4953
#maxActive = 20
@@ -66,6 +70,13 @@ idkey = 42
6670
# cf-store application
6771
# Uncomment line below to turn on the feature to add alias records to channelfinder
6872
# alias = on
73+
# The size limit for finding channels (ie the value of the '~size' query parameter)
74+
# If not specified then the fallback is the server default
75+
# findSizeLimit = 10000
76+
# Mark all channels as 'Inactive' when processor is stopped (default: True)
77+
#cleanOnStop = True
78+
# Mark all channels as 'Inactive' when processor is started (default: True)
79+
#cleanOnStart = True
6980
# Debug output file location.
7081
# Produces no file when not defined.
7182
# debug_file_loc = /home/devuser/recsyncdata.txt

server/recceiver/application.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ class Log2Twisted(logging.StreamHandler):
2121
"""
2222
def __init__(self):
2323
super(Log2Twisted,self).__init__(stream=self)
24-
self.write = log.msg
24+
# The Twisted log publisher adds a newline, so strip the newline added by the Python log handler.
25+
if sys.version_info < (3,2):
26+
self.write = lambda *args, **kwargs: log.msg(*[ str(a).strip() for a in args ], **kwargs)
27+
else:
28+
self.terminator = "" # the 'terminator' attribute was added to StreamHandler in Python v3.2
29+
self.write = log.msg
2530
def flush(self):
2631
pass
2732

@@ -33,6 +38,7 @@ def __init__(self, config):
3338
self.annperiod = float(config.get('announceInterval', '15.0'))
3439
self.tcptimeout = float(config.get('tcptimeout', '15.0'))
3540
self.commitperiod = float(config.get('commitInterval', '5.0'))
41+
self.commitSizeLimit = int(config.get('commitSizeLimit', '0'))
3642
self.maxActive = int(config.get('maxActive', '20'))
3743
self.bind, _sep, portn = config.get('bind', '').strip().partition(':')
3844
self.addrlist = []
@@ -65,6 +71,7 @@ def privilegedStartService(self):
6571
self.tcpFactory = CastFactory()
6672
self.tcpFactory.protocol.timeout = self.tcptimeout
6773
self.tcpFactory.session.timeout = self.commitperiod
74+
self.tcpFactory.session.trlimit = self.commitSizeLimit
6875
self.tcpFactory.maxActive = self.maxActive
6976

7077
# Attaching CastFactory to ProcessorController

0 commit comments

Comments
 (0)