Ron
> --
> You received this message because you are subscribed to the Google Groups "its-electric-software" group.
> To post to this group, send email to its-electr...@googlegroups.com.
> To unsubscribe from this group, send email to its-electric-sof...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/its-electric-software?hl=en.
>
Ron (and mwall), you should be able to control how much memory the
its-electric Java process uses. Just use the -Xmx command-line
parameter to Java, e.g. -Xmx128M. In order to avoid out-of-memory
errors, you *may* have to tweak the size of the database cache. To do
this, create a text file called "je.properties" inside of the
its-electric database directory, with contents the line
"je.maxMemoryPercent=10". (Its-electric uses 40% of memory for the
database cache by default.)
Meanwhile, you should be able to tweak the its-electric options for
how frequently to import in order to reduce CPU usage.
Finally, you could have the plug only record data, and not serve it
(using the --no-serve option to its-electric). Then, you can just
periodically copy the database over the network to a machine which
*can* efficiently serve the data (on which its-electric would run with
the --no-record option). A cron job running rsync leaps to mind as a
possibility. Remember, you can hot-copy the its-electric database as
long as files are copied in alphabetical order. Existing database
files are never changed, only deleted, so rsync should in general only
be copying new data.
Let me know if you need any help with any of that.
Robert
It pulls a steady 7 watts with no external devices.
I upgraded it to debian squeeze, it has a 2GB root fs
so plenty of room for programs. If you can get it
hooked up at your remote site you could have it
keep a reverse ssh tunnel open to one of your
local servers and there-by give you incoming
access to the site to do whatever you want.
If you want to just use it as a reverse gateway then
the $99 sheeva would work great.
Finally, you could have the plug only record data, and not serve it
(using the --no-serve option to its-electric). Then, you can just
periodically copy the database over the network to a machine which
*can* efficiently serve the data (on which its-electric would run with
the --no-record option). A cron job running rsync leaps to mind as a
possibility. Remember, you can hot-copy the its-electric database as
long as files are copied in alphabetical order. Existing database
files are never changed, only deleted, so rsync should in general only
be copying new data.
Robert
I have never worked with running java as a servlet so am on a learning curve,
but I believe you said that it would use up to 40% for cache and a max
of the memory parameter. After running 24 hours this is what I have
3448 root 20 0 526m 398m 292 S 45.9 79.4 1252:09 java
it is using 526m virtual, 398m real memory, with 45%cpu and 79.4% of total memory.
Is there something I am missing as this all seems to exceed the default limits
you described. It is also running my weather station software and some minor monitoring
software. Without it's electric it is less then 1% cpu and has like 394m of the 512m
of memory free.
Ron
Robert
I restarted it and after running about 30 minutes it is very reasonable
root 20 0 395m 111m 5060 S 0.3 22.2 30:34.73 java
395m Virt 111m real, .3% cpu and 22.2% ram
Just wondering if there is some sort of thrashing or some anomaly with the small memory footprint
going on that makes it continually suck up more resources at time passes.
exec /usr/bin/java -server -Xmx256m -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simpl
elog.defaultlog=debug -jar /opt/ted/its-electric-1.7.4.jar -g http://192.168.1.75 -p 8081 -m 4 -l stderr -u username /opt/ted/electricDb >> /opt/
ted/its-electric.log 2>&1 <<<password
Ron
I'd hope you could get away with using considerably less memory...
Let's see. When your its-electric gets busy, try running "jstack PID"
to see a thread dump, and send me the results.
Robert
Here are some things to try.
(1) Give Java an explicit memory limit, using an option to java like
-Xmx256M. (Or 128M, or 64M. Too low and you'll need to tweak
database parameters as I outlined in an earlier message; but I bet
128M would just work. I know 256M just works.)
(2) Use Oracle's Java instead of OpenJDK. Here's a site where someone
describes making that switch due to OpenJDK using too much memory:
http://wiki.apidesign.org/wiki/Virtualization
If those don't work... or if (1) doesn't work and you really need to
use OpenJDK for some reason... let me know.
For a record-only instance of its-electric, you could add the options
--no-serve --import-interval 0 --long-import-interval 1200 which has
its-electric ask TED for an hour of data every 20 minutes, and turns
off the data server and the more frequent small imports. You need (1)
or (2) above to fix your memory problem, but this is probably a good
idea just to make the thing work as little as possible.
Robert
After 5 days I have this.
1886 root 20 0 396m 271m 1740 S 2.0 54.2 1125:30 java
So using 54% of the 512M ram.
So 271m res and 396m Virt
My startup is
/usr/bin/java -server -Xmx256m -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.defaultlog=debug -jar /opt/ted/its-electric-1.7.4.jar -g http://192.168.1.75 -p 8081 -m 4 -l stderr -u username /opt/ted/electricD
My problem is drive space trying to only use flash and about full on my 8gb so have to come
up with something else. I have written a python program to dump all the data from the
unit into sqlite, the seconds table up to the month table. Just need to either come up with some
sort of graphics engine or somehow pipe it into its-electric. I am doubtfull that it could
feed the data fast enough to power an app like it-s electric but at least I have all the data
stored and I can even insert missing second records from the minute or even the hourly
data.
Still on the 1.7.4 version so I know he made some improvements with memory but haven't
had a chance to convert yet.
I'd appreciate it if you send me your log. You probably need to add
options (to java) to get useful logging:
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
-Dorg.apache.commons.logging.simplelog.defaultlog=trace
You could also do "jstack PID", a few times even, during high-CPU use.
This generates a thread dump.
Finally, the ability to turn off the short import was added in the
recent its-electric 1.8. If you need to use 1.7.4 you could try
"--import-interval 1200 --long-import-interval 1200", setting both to
20 minutes. That may go far to easing up on the CPU usage.
Robert
Robert