Giter VIP home page Giter VIP logo

smf's Introduction

We're looking for a new maintainer for the SMF project. As I have little time to keep up with issues. Please let me know by filing an issue.

smf is pronounced /smɝf/

Site Link
Mailing List https://groups.google.com/forum/#!forum/smf-dev
Documentation https://smfrpc.github.io/smf/

Please visit our official documentation, it'll get you up and running in no time!

If you are using smf, drop us a line on the mailing list introducing your project.

What is smf?

smf is a new RPC system and code generation like gRPC, Cap n Proto, Apache Thrift, etc, but designed for microsecond tail latency*.

Current benchmarks in microseconds (e2e see docs)

60 byte payload latency
p50 7us
p90 8us
p99 8us
p9999 15us
p100 26us

Getting started

Please see our quick getting started on our official docs!

smf's People

Contributors

crackcomm avatar dependabot[bot] avatar dotnwat avatar duarten avatar emaxerrno avatar hellertime avatar kowalczykbartek avatar lion19 avatar lumontec avatar mmaslankaprv avatar youjiali1995 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smf's Issues

add bit on the filename to indicate still writing... big deal when reading

mak with a number like 0,1 ala

\d?_smf\d+_(\d+).wal

from

smf\d+_(\d+).wal

allows us to embed status information on the filename.
maybefilename should be a

struct filename{
   char prefix[4];
   uint16_t core;
   uint32_t status
   uint64_t epoch;
  char padding___[4]; // or the gcc macros
};

this will effecitvely allows us to char* copy (srd, dest) as the filename and automagically extract all the status...

maybe... retrofit stuff to fix it. - could generate it w/ flatbuffers wihich will automagicall ypad like that too.

use the filtering mechanics of the RPC w/ the WAL filters

the WAL can be encrypted, compressed, split, etc.

Use a similar --> filters [ many ] -> save for input and

read --> undo_filteers [ many ] -> user for output of the WAL.

Allows for data at rest. Might need to come up w/ database header format per file. - maybe increase filesize?

serialize writes per co-routine

given multiple futures on a single wal_writer_node.*{h,cc}

and also assuming tha tyou have a big write payload i.e.: > max_file_size

and assuming that one of them is less than max_file_size you might interleave the writes to the wal file.

use a seastar::semaphore to serialize writes and yield other co-routines until ready.

use LOG_*_IF

look for all the simple if () LOG... and change them to LOG_*_IF to capture the conditional

filesystem/cmakelist.txt

clean up all the separate impl files into their own actual .cc files
& update the cmake file.

after prototype is finished.

localhost tests

DPDK is really hard to test as there is no localhost, however seastar has a
wrapper for localhost that effecitvely uses their future mechanism for testing.

Need to figure out how to run their unit tests.

rpc_typed_envelope

We already have the rpc_recv_typed_context which is the exact same type of template i would
want to use for the rpc_typed_envelope so all we have to do is make this a template of 2 types.

One for receive and one for send. and make aliases.

template<typename T>
struct rpc_typed_envelope : public rpc_typed<T, rpc_envelope> {} ;

struct rpc_recv_typed_context: public rpc_typed<MyType, rpc_recv_context> {} ;
#pragma once
#include "rpc/rpc_recv_context.h"
namespace smf {
template <typename T> struct rpc_recv_typed_context {
  using type = T;
  using opt_recv_ctx_t = std::experimental::optional<rpc_recv_context>;

  rpc_recv_typed_context() : ctx(std::experimental::nullopt) {}
  rpc_recv_typed_context(opt_recv_ctx_t t) : ctx(std::move(t)) {}
  rpc_recv_typed_context(rpc_recv_typed_context<T> &&o) noexcept
    : ctx(std::move(o.ctx)) {}

  T *get() {
    if(ctx) {
      return flatbuffers::GetMutableRoot<T>(
        ctx.value().payload->mutable_body()->Data());
    }
    return nullptr;
  }

  /// \brief returns true of this obj
  /// so that it works with
  /// \code
  ///     if(obj){}
  /// \endcode
  /// simply forward the bool operator to the option
  operator bool() const { return ctx.operator bool(); }
  opt_recv_ctx_t ctx;
};
}

add wal_file_manager.h

righ tnow the filename is

smf<core: uint16_t>_<epoch: uint64_t>.wal

with programmable prefix from smf to user input...

adds unnecessary param. remove.

wal names must include timestamp or run risk of overriding data.

if the wal is

smf0_1234.wal

without a time stamp, next time l-core 0 starts up at 1234 epoch it will override the same name.

This only happens If and only if, the file is empty. Otherwise it will move the offset to the correct byte.

The proposed change would label it like this:

run:<id-microsecond>:smf:0:1234.wal

testing:repeat - currently the unit test for wal.h fails on second run

We should add the number of times we would like to run a test - realy a main for the integration tests.

Currently i discovered a bug on the wal.h on second writes since it does directory scanning after. I think there is a raise condition on the cores it tries to do it.

In addition to we should change the number of cores from run to run.

{
"repeat_in_same_dir": true
"repeat_time": 3
}

refactor wal-clock-pro out into a generic cache lib

Effectively, the wal-clock-pro, page-chunk, sorting, shuffling, etc. can be a generic cache.

it can even be templetized by async_clock_pro vs clock_pro

src/utils/caching/wal_clock.h

it can operate on a struct w/ public funcs
and the wrappers will simply use that.

Also uses a std::array behind the scenes.

add http server

the http server is for metrics similar to google /varz or .. any modern db... aka kudu.

Easy to see latency metrics of the RPC's as well as logs and ... all the seastar

engine() metrics.

change macros for structs

I just discovered 2 bugs on the wal_requests.h by disabling copy and assignment.

Go through each file and ensure that you aren't paying any copies accidentally.

Mostly it involves having move constructors for all default types.

via

// A macro to disallow the copy constructor and operator= functions
// This is usually placed in the private: declarations for a class.
#define SMF_DISALLOW_COPY_AND_ASSIGN(TypeName) \
  TypeName(const TypeName &) = delete;         \
  void operator=(const TypeName &) = delete

#define SMF_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
  TypeName() = delete;                               \
  SMF_DISALLOW_COPY_AND_ASSIGN(TypeName)

use smaller enums

rpc and wal.fbs

use big ints (uint) to store bit flags. Realistically, we can use smaller enums (byte) that have semantic meaning rather than bitfields... same size on the wire. i.e.: we can have 4 enums representing all the combinations we want. on the wire, it's padded to the largest struct via

std::align(... destructive) ... so we get aligned for the width of L1 - which on recent seastar mailing list it proved to be 64.

folly aligns to be 128... but that's no longer the case. PPL suggest to align 64. -

flatbuffers does all this for us, so no need to worry anyways.

Also need fully serialized types so that the users can simply push a serialized type. It's going to make writing easier.

add lifecycle callback struct for client and server rpc connection management

struct connection_callbacks {
    void connection_open(const ...&);
    void connection_error(const ...&);
    void connection_exception(const ...&);
    void will_parse_header();
    void did_parse_header(const &)....
    void will_parse_body()
    void did_parse_body(const &...)
    void connection_set_error()...
    void connection_disable....
    void connection flushing
   void connection_close
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.