This is a read-only archive!

Blog is still going strong

After I implemented that silly CAPTCHA yesterday, the spam was stopped. There's also a honeypot form field (it's hidden via CSS so humans don't know it's there, and if any bot POSTs text for that field, the data is rejected automatically). It's silly and easily defeated, yet it stopped all 262 spam attempts since yesterday. It looks like all the spam is for one site, but it's coming from a huge range of IPs. So it's probably a botnet. Thanks, MS Windows!

I rewrote my whole CRUD layer so that I could use it for more than one database at once, and then rewrote my gallery code to take advantage, and now two hours later I have my origami gallery back up and running. Both sites are running from the same JVM. I wonder how many sites I can have going at once before the server melts into a puddle of Java-inflicted goo.

11338 16   0  512m 128m  12m S    0  0.3   0:28.33 java

Good thing I have plenty of RAM on the server. From looking at before and after shots of the memory usage, 66 MB is the JVM itself, and 40MB more is Jetty and Compojure and my code and all the dependencies. Then the last ~20 MB or so is my database slurped into RAM. So I can probably fit another few tens of thousands of posts and comments in here before I have to worry much. The real test will be letting this thing run for a couple weeks and see how hard it leaks.

This post is related to Darn you, spammers.
March 18, 2009 @ 3:01 PM PDT
Cateogory: Programming


Quoth ph0enix on March 19, 2009 @ 9:59 AM PDT

If I understand you correctly, you read the entire database into memory when apache starts up and then user posts etc are all taken and put into memory.

If the above is correct and your database is in memory, how often do you sync with the database on your hard drive?

Quoth Brian on March 19, 2009 @ 11:39 AM PDT

The DB is read into RAM when I start Clojure and run my scripts, not when Apache is started.

Updates are written to disk any time anything is edited. So when you post a comment, when I make a new blog post, when I delete spam, when I edit a post etc. it updates twice, once in the in-RAM Clojure refs and also into the DB. Updates are very infrequent so it doesn't matter how slow they are.